All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
identity-management-fixture.hpp
1 
23 #ifndef NDN_IDENTITY_MANAGEMENT_FIXTURE_HPP
24 #define NDN_IDENTITY_MANAGEMENT_FIXTURE_HPP
25 
26 #include <set>
27 #include <ndn-cpp/security/key-chain.hpp>
28 
30 {
31 public:
33  : keyChain_("pib-memory:", "tpm-memory:")
34  {
35  }
36 
38 
39  bool
40  saveCertificateToFile(const ndn::Data& data, const std::string& filePath);
41 
49  ndn::ptr_lib::shared_ptr<ndn::PibIdentity>
51  (const ndn::Name& identityName,
52  const ndn::KeyParams& params = ndn::KeyChain::getDefaultKeyParams());
53 
60  bool
61  saveCertificate(ndn::PibIdentity identity, const std::string& filePath);
62 
74  ndn::ptr_lib::shared_ptr<ndn::PibIdentity>
76  (const ndn::Name& subIdentityName,
77  const ndn::ptr_lib::shared_ptr<ndn::PibIdentity>& issuer,
78  const ndn::KeyParams& params = ndn::KeyChain::getDefaultKeyParams());
79 
86  ndn::ptr_lib::shared_ptr<ndn::CertificateV2>
88  (ndn::ptr_lib::shared_ptr<ndn::PibKey>& key, const std::string& issuerId);
89 
90  ndn::KeyChain keyChain_;
91 
92 private:
93  std::set<ndn::Name> identityNames_;
94  std::set<std::string> certificateFiles_;
95 };
96 
97 
98 #endif
Copyright (C) 2017-2018 Regents of the University of California.
Definition: identity-management-fixture.hpp:29
Definition: data.hpp:37
ndn::ptr_lib::shared_ptr< ndn::PibIdentity > addSubCertificate(const ndn::Name &subIdentityName, const ndn::ptr_lib::shared_ptr< ndn::PibIdentity > &issuer, const ndn::KeyParams &params=ndn::KeyChain::getDefaultKeyParams())
Issue a certificate for subIdentityName signed by issuer.
Definition: identity-management-fixture.cpp:84
KeyChain is the main class of the security library.
Definition: key-chain.hpp:53
PibIdentity is at the top level in PIB's Identity-Key-Certificate hierarchy.
Definition: pib-identity.hpp:48
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
ndn::ptr_lib::shared_ptr< ndn::CertificateV2 > addCertificate(ndn::ptr_lib::shared_ptr< ndn::PibKey > &key, const std::string &issuerId)
Add a self-signed certificate made from the key and issuer ID.
Definition: identity-management-fixture.cpp:112
KeyParams is a base class for key parameters.
Definition: key-params.hpp:36
bool saveCertificate(ndn::PibIdentity identity, const std::string &filePath)
Save the identity's certificate to a file.
Definition: identity-management-fixture.cpp:70
ndn::ptr_lib::shared_ptr< ndn::PibIdentity > addIdentity(const ndn::Name &identityName, const ndn::KeyParams &params=ndn::KeyChain::getDefaultKeyParams())
Add an identity for the identityName.
Definition: identity-management-fixture.cpp:60