22 #ifndef NDN_CXX_SECURITY_PIB_KEY_HPP
23 #define NDN_CXX_SECURITY_PIB_KEY_HPP
44 class Key :
private boost::equality_comparable<Key>
118 operator
bool() const noexcept;
132 addCertificate(const
Certificate& certificate) const;
139 removeCertificate(const
Name& certName) const;
148 setDefaultCertificate(const
Name& certName) const;
155 setDefaultCertificate(const
Certificate& certificate) const;
159 Key(weak_ptr<KeyImpl> impl) noexcept;
171 equals(const
Key& other) const noexcept;
179 operator==(const
Key& lhs, const
Key& rhs) noexcept
181 return lhs.equals(rhs);
190 return os <<
"(empty)";
194 weak_ptr<KeyImpl> m_impl;
Represents an absolute name.
Represents a name component.
Represents an NDN certificate.
The main interface for signing key management.
Container of certificates of a key.
Container of keys of an identity.
Frontend handle for a key in the PIB.
friend std::ostream & operator<<(std::ostream &os, const Key &key)
KeyType getKeyType() const
Return the key type.
const Certificate & getDefaultCertificate() const
Return the default certificate for this key.
const Name & getIdentity() const
Return the name of the owning identity.
Key() noexcept
Default constructor.
span< const uint8_t > getPublicKey() const
Return the raw public key bits.
Certificate getCertificate(const Name &certName) const
Return the certificate with the given name.
const Name & getName() const
Return the name of the key.
const CertificateContainer & getCertificates() const
Return all the certificates of this key.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Contains the ndn-cxx security framework.
Name extractIdentityFromKeyName(const Name &keyName)
Extract identity namespace from the key name keyName.
bool isValidKeyName(const Name &keyName)
Check if keyName follow the naming conventions for the key name.
Name constructKeyName(const Name &identity, const name::Component &keyId)
Construct key name based on the appropriate naming conventions.
KeyType
The type of a cryptographic key.