23 #ifndef NDN_PIB_KEY_IMPL_HPP
24 #define NDN_PIB_KEY_IMPL_HPP
26 #include <ndn-cpp/security/pib/pib-certificate-container.hpp>
27 #include <ndn-cpp/security/security-common.hpp>
30 class TestPibKeyImpl_CertificateOperation_Test;
51 (
const Name& keyName,
const uint8_t* keyEncoding,
size_t keyEncodingLength,
52 const ptr_lib::shared_ptr<PibImpl>& pibImpl);
61 PibKeyImpl(
const Name& keyName,
const ptr_lib::shared_ptr<PibImpl>& pibImpl);
68 getName()
const {
return keyName_; }
120 ptr_lib::shared_ptr<CertificateV2>
132 ptr_lib::shared_ptr<CertificateV2>&
144 ptr_lib::shared_ptr<CertificateV2>&
156 ptr_lib::shared_ptr<CertificateV2>&
162 friend TestPibKeyImpl_CertificateOperation_Test;
173 ptr_lib::shared_ptr<CertificateV2> defaultCertificate_;
177 ptr_lib::shared_ptr<PibImpl> pibImpl_;
A PibCertificateContainer is used to search/enumerate the certificates of a key.
Definition: pib-certificate-container.hpp:44
CertificateV2 represents a certificate following the certificate format naming convention.
Definition: certificate-v2.hpp:81
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
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
PibKeyImpl provides the backend implementation for PibKey.
Definition: pib-key-impl.hpp:39
ptr_lib::shared_ptr< CertificateV2 > & setDefaultCertificate(const Name &certificateName)
Set the existing certificate with name certificateName as the default certificate.
Definition: pib-key-impl.cpp:98
void removeCertificate(const Name &certificateName)
Remove the certificate with name certificateName.
Definition: pib-key-impl.cpp:80
const Blob & getPublicKey() const
Get the public key encoding.
Definition: pib-key-impl.hpp:89
ptr_lib::shared_ptr< CertificateV2 > & getDefaultCertificate()
Get the default certificate for this Key.
Definition: pib-key-impl.cpp:108
ptr_lib::shared_ptr< CertificateV2 > getCertificate(const Name &certificateName)
Get the certificate with name certificateName.
Definition: pib-key-impl.cpp:91
KeyType getKeyType() const
Get the key type.
Definition: pib-key-impl.hpp:82
void addCertificate(const CertificateV2 &certificate)
Add the certificate.
Definition: pib-key-impl.cpp:73
ptr_lib::shared_ptr< CertificateV2 > & setDefaultCertificate(const CertificateV2 &certificate)
Add the certificate and set it as the default certificate of the key.
Definition: pib-key-impl.hpp:145
PibKeyImpl(const Name &keyName, const uint8_t *keyEncoding, size_t keyEncodingLength, const ptr_lib::shared_ptr< PibImpl > &pibImpl)
Create a PibKeyImpl with keyName.
Definition: pib-key-impl.cpp:34
const Name & getIdentityName() const
Get the name of the identity this key belongs to.
Definition: pib-key-impl.hpp:75