22 #ifndef NDN_CXX_SECURITY_PIB_KEY_HPP
23 #define NDN_CXX_SECURITY_PIB_KEY_HPP
124 operator
bool() const noexcept;
138 addCertificate(const
Certificate& certificate) const;
145 removeCertificate(const
Name& certName) const;
154 setDefaultCertificate(const
Name& certName) const;
161 setDefaultCertificate(const
Certificate& certificate) const;
165 Key(weak_ptr<detail::KeyImpl> impl) noexcept;
173 shared_ptr<detail::KeyImpl>
177 equals(const
Key& other) const noexcept;
184 operator==(const
Key& lhs, const
Key& rhs)
186 return lhs.equals(rhs);
192 return !lhs.equals(rhs);
198 return os << (key ? key.
getName() :
"(empty)");
202 weak_ptr<detail::KeyImpl> m_impl;
212 inline namespace v2 {
Represents an absolute name.
Represents a name component.
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.
friend bool operator!=(const Key &lhs, const Key &rhs)
Represents an NDN certificate.
The main interface for signing key management.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
bool isValidKeyName(const Name &keyName)
Check if keyName follow the naming conventions for the key name.
Name extractIdentityFromKeyName(const Name &keyName)
Extract identity namespace from the key name keyName.
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.