|
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.
36 , m_pib(std::
move(pibImpl))
37 , m_certificates(keyName, m_pib)
38 , m_isDefaultCertificateLoaded(false)
40 BOOST_ASSERT(m_pib !=
nullptr);
51 m_pib->addKey(m_identity, m_keyName, key, keyLen);
57 , m_pib(std::
move(pibImpl))
58 , m_certificates(keyName, m_pib)
59 , m_isDefaultCertificateLoaded(false)
61 BOOST_ASSERT(m_pib !=
nullptr);
63 m_key = m_pib->getKeyBits(m_keyName);
66 key.
loadPkcs8(m_key.data(), m_key.size());
74 m_certificates.
add(certificate);
82 if (m_isDefaultCertificateLoaded && m_defaultCertificate.
getName() == certName)
83 m_isDefaultCertificateLoaded =
false;
85 m_certificates.
remove(certName);
92 return m_certificates.
get(certName);
99 return m_certificates;
107 m_defaultCertificate = m_certificates.
get(certName);
108 m_pib->setDefaultCertificateOfKey(m_keyName, certName);
109 m_isDefaultCertificateLoaded =
true;
110 return m_defaultCertificate;
125 if (!m_isDefaultCertificateLoaded) {
126 m_defaultCertificate = m_pib->getDefaultCertificateOfKey(m_keyName);
127 m_isDefaultCertificateLoaded =
true;
129 BOOST_ASSERT(m_pib->getDefaultCertificateOfKey(m_keyName).wireEncode() == m_defaultCertificate.
wireEncode());
131 return m_defaultCertificate;
void add(const v2::Certificate &certificate)
Add certificate into the container.
KeyImpl(const Name &keyName, const uint8_t *key, size_t keyLen, shared_ptr< PibImpl > pibImpl)
Create a KeyImpl with keyName.
Container of certificates of a key.
size_t wireEncode(EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
Prepend wire encoding to encoder in NDN Packet Format v0.2.
const Name & getName() const
Get name.
Name extractIdentityFromKeyName(const Name &keyName)
Extract identity namespace from the key name keyName.
const v2::Certificate & setDefaultCertificate(const Name &certName)
Set an existing certificate with name certName as the default certificate.
#define NDN_THROW_NESTED(e)
v2::Certificate getCertificate(const Name &certName) const
Get a certificate with certName.
Represents an absolute name.
The certificate following the certificate format naming convention.
void removeCertificate(const Name &certName)
Remove a certificate with certName.
const v2::Certificate & getDefaultCertificate() const
Get the default certificate for this key.
void remove(const Name &certName)
Remove a certificate with certName from the container.
v2::Certificate get(const Name &certName) const
Get a certificate with certName from the container.
void addCertificate(const v2::Certificate &certificate)
Add certificate.
const CertificateContainer & getCertificates() const
Get all the certificates for this key.
bool isConsistent() const
Check if the container is consistent with the backend storage.
Copyright (c) 2011-2015 Regents of the University of California.