23 #ifndef NDN_PIB_KEY_HPP
24 #define NDN_PIB_KEY_HPP
26 #include <ndn-cpp/security/security-common.hpp>
27 #include "pib-certificate-container.hpp"
30 class TestKeyChain_Management_Test;
85 ptr_lib::shared_ptr<CertificateV2>
94 ptr_lib::shared_ptr<CertificateV2>&
126 friend TestKeyChain_Management_Test;
132 PibKey(ptr_lib::weak_ptr<PibKeyImpl> impl);
156 removeCertificate(
const Name& certificateName);
168 const ptr_lib::shared_ptr<CertificateV2>&
169 setDefaultCertificate(
const Name& certificateName);
181 const ptr_lib::shared_ptr<CertificateV2>&
192 getCertificates()
const {
return const_cast<PibKey*
>(
this)->getCertificates(); }
199 ptr_lib::shared_ptr<PibKeyImpl>
206 ptr_lib::weak_ptr<PibKeyImpl> impl_;
A PibCertificateContainer is used to search/enumerate the certificates of a key.
Definition: pib-certificate-container.hpp:44
ptr_lib::shared_ptr< CertificateV2 > getCertificate(const Name &certificateName)
Get the certificate with name certificateName.
Definition: pib-key.cpp:49
static bool isValidKeyName(const Name &keyName)
Check if keyName follows the naming conventions for a key name.
Definition: pib-key.cpp:82
ptr_lib::shared_ptr< CertificateV2 > & getDefaultCertificate()
Get the default certificate for this Key.
Definition: pib-key.cpp:55
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
static Name constructKeyName(const Name &identityName, const Name::Component &keyId)
Construct a key name based on the appropriate naming conventions.
Definition: pib-key.cpp:73
A Name::Component holds a read-only name component value.
Definition: name.hpp:45
KeyType
Definition: security-common.hpp:50
The PibKey class provides access to a key at the second level in the PIB's Identity-Key-Certificate h...
Definition: pib-key.hpp:43
KeyChain is the main class of the security library.
Definition: key-chain.hpp:53
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
static Name extractIdentityFromKeyName(const Name &keyName)
Extract the identity namespace from keyName.
Definition: pib-key.cpp:90
const Name & getIdentityName()
Get the name of the identity this key belongs to.
Definition: pib-key.cpp:40
const Blob & getPublicKey()
Get the public key encoding.
Definition: pib-key.cpp:46
A PibKeyContainer is used to search/enumerate the keys of an identity.
Definition: pib-key-container.hpp:42
KeyType getKeyType()
Get the key type.
Definition: pib-key.cpp:43