|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
40 return lock()->getName();
46 return lock()->getIdentity();
52 return lock()->getKeyType();
58 return lock()->getPublicKey();
64 return lock()->addCertificate(certificate);
70 return lock()->removeCertificate(certName);
76 return lock()->getCertificate(certName);
82 return lock()->getCertificates();
88 return lock()->setDefaultCertificate(certName);
94 return lock()->setDefaultCertificate(certificate);
100 return lock()->getDefaultCertificate();
103 Key::operator bool()
const
105 return !m_impl.expired();
108 shared_ptr<detail::KeyImpl>
111 auto impl = m_impl.lock();
113 if (impl ==
nullptr) {
114 NDN_THROW(std::domain_error(
"Invalid key instance"));
123 return lhs.m_impl.owner_before(rhs.m_impl) || rhs.m_impl.owner_before(lhs.m_impl);
145 Name keyName = identity;
163 NDN_THROW(std::invalid_argument(
"Key name `" + keyName.
toUri() +
"` "
164 "does not respect the naming conventions"));
KeyType
The type of a cryptographic key.
const v2::Certificate & setDefaultCertificate(const Name &certName) const
Set an existing certificate with certName as the default certificate.
const v2::Certificate & getDefaultCertificate() const
Get the default certificate for this Key.
bool isValidKeyName(const Name &keyName)
Check if keyName follow the naming conventions for the key name.
General-purpose automatically managed/resized buffer.
size_t size() const
Returns the number of components.
Container of certificates of a key.
static const name::Component KEY_COMPONENT
Name constructKeyName(const Name &identity, const name::Component &keyId)
Construct key name based on the appropriate naming conventions.
KeyType getKeyType() const
Get key type.
Name extractIdentityFromKeyName(const Name &keyName)
Extract identity namespace from the key name keyName.
Represents an absolute name.
The certificate following the certificate format naming convention.
bool operator!=(const Identity &lhs, const Identity &rhs)
Name & append(const Component &component)
Append a component.
PartialName getPrefix(ssize_t nComponents) const
Returns a prefix of the name.
void removeCertificate(const Name &certName) const
Remove a certificate with certName.
void toUri(std::ostream &os, name::UriFormat format=name::UriFormat::DEFAULT) const
Write URI representation of the name to the output stream.
std::ostream & operator<<(std::ostream &os, const Identity &id)
v2::Certificate getCertificate(const Name &certName) const
Get a certificate with certName.
const CertificateContainer & getCertificates() const
Get all certificates for this key.
Represents a name component.
const Name & getName() const
Get key name.
A frontend handle of a key instance.
const Name & getIdentity() const
Get the name of the belonging identity.
static const size_t MIN_KEY_NAME_LENGTH
const Buffer & getPublicKey() const
Get public key bits.
const Component & get(ssize_t i) const
Returns an immutable reference to the component at the specified index.
Key()
Default Constructor.
Copyright (c) 2011-2015 Regents of the University of California.