NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::v1::Certificate Class Reference

#include <certificate.hpp>

Inheritance diagram for ndn::security::v1::Certificate:
Collaboration diagram for ndn::security::v1::Certificate:

Classes

class  Error
 

Public Types

typedef std::vector< CertificateSubjectDescriptionSubjectDescriptionList
 
typedef std::vector< CertificateExtensionExtensionList
 

Public Member Functions

 Certificate ()
 The default constructor. More...
 
 Certificate (const Data &data)
 Create a Certificate from the content in the data packet. More...
 
 Certificate (const Block &block)
 Create a Certificate from the a block. More...
 
virtual ~Certificate ()
 
void wireDecode (const Block &wire)
 
void encode ()
 encode certificate info into content More...
 
void addSubjectDescription (const CertificateSubjectDescription &description)
 Add a subject description. More...
 
const SubjectDescriptionListgetSubjectDescriptionList () const
 
SubjectDescriptionListgetSubjectDescriptionList ()
 
void addExtension (const CertificateExtension &extension)
 Add a certificate extension. More...
 
const ExtensionListgetExtensionList () const
 
ExtensionListgetExtensionList ()
 
void setNotBefore (const time::system_clock::TimePoint &notBefore)
 
time::system_clock::TimePointgetNotBefore ()
 
const time::system_clock::TimePointgetNotBefore () const
 
void setNotAfter (const time::system_clock::TimePoint &notAfter)
 
time::system_clock::TimePointgetNotAfter ()
 
const time::system_clock::TimePointgetNotAfter () const
 
void setPublicKeyInfo (const PublicKey &key)
 
PublicKeygetPublicKeyInfo ()
 
const PublicKeygetPublicKeyInfo () const
 
bool isTooEarly ()
 Check if the certificate is valid. More...
 
bool isTooLate ()
 Check if the certificate is valid. More...
 
void printCertificate (std::ostream &os, const std::string &indent="") const
 
- Public Member Functions inherited from ndn::Data
 Data ()
 Create an empty Data object. More...
 
 Data (const Name &name)
 Create a new Data object with the given name. More...
 
 Data (const Block &wire)
 Create a new Data object from wire encoding. More...
 
template<encoding::Tag TAG>
size_t wireEncode (EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const
 Fast encoding or block size estimation. More...
 
const BlockwireEncode () const
 Encode to a wire format. More...
 
const BlockwireEncode (EncodingBuffer &encoder, const Block &signatureValue) const
 Finalize Data packet encoding with the specified SignatureValue. More...
 
void wireDecode (const Block &wire)
 Decode from the wire format. More...
 
bool hasWire () const
 Check if Data is already has wire encoding. More...
 
const NamegetName () const
 Get name of the Data packet. More...
 
DatasetName (const Name &name)
 Set name to a copy of the given Name. More...
 
const NamegetFullName () const
 Get full name of Data packet, including the implicit digest. More...
 
const MetaInfogetMetaInfo () const
 Get MetaInfo block from Data packet. More...
 
DatasetMetaInfo (const MetaInfo &metaInfo)
 Set metaInfo to a copy of the given MetaInfo. More...
 
uint32_t getContentType () const
 
DatasetContentType (uint32_t type)
 
const time::milliseconds & getFreshnessPeriod () const
 
DatasetFreshnessPeriod (const time::milliseconds &freshnessPeriod)
 
const name::ComponentgetFinalBlockId () const
 
DatasetFinalBlockId (const name::Component &finalBlockId)
 
const BlockgetContent () const
 Get content Block. More...
 
DatasetContent (const uint8_t *buffer, size_t bufferSize)
 Set the content from the buffer (buffer will be copied) More...
 
DatasetContent (const Block &block)
 Set the content from the block. More...
 
DatasetContent (const ConstBufferPtr &contentValue)
 Set the content from the pointer to immutable buffer. More...
 
const SignaturegetSignature () const
 
DatasetSignature (const Signature &signature)
 Set the signature to a copy of the given signature. More...
 
DatasetSignatureValue (const Block &value)
 
bool operator== (const Data &other) const
 
bool operator!= (const Data &other) const
 
- Public Member Functions inherited from ndn::TagHost
template<typename T >
shared_ptr< T > getTag () const
 get a tag item More...
 
template<typename T >
void setTag (shared_ptr< T > tag) const
 set a tag item More...
 
template<typename T >
void removeTag () const
 remove tag item More...
 

Protected Member Functions

void decode ()
 
- Protected Member Functions inherited from ndn::Data
void onChanged ()
 Clear the wire encoding. More...
 

Protected Attributes

SubjectDescriptionList m_subjectDescriptionList
 
time::system_clock::TimePoint m_notBefore
 
time::system_clock::TimePoint m_notAfter
 
PublicKey m_key
 
ExtensionList m_extensionList
 

Detailed Description

Definition at line 39 of file certificate.hpp.

Member Typedef Documentation

◆ SubjectDescriptionList

◆ ExtensionList

Constructor & Destructor Documentation

◆ Certificate() [1/3]

ndn::security::v1::Certificate::Certificate ( )

The default constructor.

Definition at line 45 of file certificate.cpp.

◆ Certificate() [2/3]

ndn::security::v1::Certificate::Certificate ( const Data data)
explicit

Create a Certificate from the content in the data packet.

Parameters
dataThe data packet with the content to decode.

Definition at line 51 of file certificate.cpp.

References decode().

◆ Certificate() [3/3]

ndn::security::v1::Certificate::Certificate ( const Block block)
explicit

Create a Certificate from the a block.

Parameters
blockThe raw block of the certificate

Definition at line 58 of file certificate.cpp.

References decode().

◆ ~Certificate()

ndn::security::v1::Certificate::~Certificate ( )
virtual

Definition at line 64 of file certificate.cpp.

Member Function Documentation

◆ wireDecode()

void ndn::security::v1::Certificate::wireDecode ( const Block wire)

◆ encode()

◆ addSubjectDescription()

void ndn::security::v1::Certificate::addSubjectDescription ( const CertificateSubjectDescription description)
inline

Add a subject description.

Parameters
descriptionThe description to be added.

Definition at line 91 of file certificate.hpp.

References m_subjectDescriptionList.

◆ getSubjectDescriptionList() [1/2]

const SubjectDescriptionList& ndn::security::v1::Certificate::getSubjectDescriptionList ( ) const
inline

Definition at line 97 of file certificate.hpp.

References m_subjectDescriptionList.

◆ getSubjectDescriptionList() [2/2]

SubjectDescriptionList& ndn::security::v1::Certificate::getSubjectDescriptionList ( )
inline

Definition at line 103 of file certificate.hpp.

References m_subjectDescriptionList.

◆ addExtension()

void ndn::security::v1::Certificate::addExtension ( const CertificateExtension extension)
inline

Add a certificate extension.

Parameters
extensionthe extension to be added

Definition at line 113 of file certificate.hpp.

References m_extensionList.

◆ getExtensionList() [1/2]

const ExtensionList& ndn::security::v1::Certificate::getExtensionList ( ) const
inline

Definition at line 119 of file certificate.hpp.

References m_extensionList.

◆ getExtensionList() [2/2]

ExtensionList& ndn::security::v1::Certificate::getExtensionList ( )
inline

Definition at line 125 of file certificate.hpp.

References m_extensionList.

◆ setNotBefore()

void ndn::security::v1::Certificate::setNotBefore ( const time::system_clock::TimePoint notBefore)
inline

Definition at line 131 of file certificate.hpp.

References m_notBefore.

◆ getNotBefore() [1/2]

time::system_clock::TimePoint& ndn::security::v1::Certificate::getNotBefore ( )
inline

Definition at line 137 of file certificate.hpp.

References m_notBefore.

Referenced by ndn::security::SecPublicInfoSqlite3::addCertificate().

◆ getNotBefore() [2/2]

const time::system_clock::TimePoint& ndn::security::v1::Certificate::getNotBefore ( ) const
inline

Definition at line 143 of file certificate.hpp.

References m_notBefore.

◆ setNotAfter()

void ndn::security::v1::Certificate::setNotAfter ( const time::system_clock::TimePoint notAfter)
inline

Definition at line 149 of file certificate.hpp.

References m_notAfter.

◆ getNotAfter() [1/2]

time::system_clock::TimePoint& ndn::security::v1::Certificate::getNotAfter ( )
inline

Definition at line 155 of file certificate.hpp.

References m_notAfter.

Referenced by ndn::security::SecPublicInfoSqlite3::addCertificate().

◆ getNotAfter() [2/2]

const time::system_clock::TimePoint& ndn::security::v1::Certificate::getNotAfter ( ) const
inline

Definition at line 161 of file certificate.hpp.

References m_notAfter.

◆ setPublicKeyInfo()

void ndn::security::v1::Certificate::setPublicKeyInfo ( const PublicKey key)
inline

Definition at line 167 of file certificate.hpp.

References m_key.

◆ getPublicKeyInfo() [1/2]

◆ getPublicKeyInfo() [2/2]

const PublicKey& ndn::security::v1::Certificate::getPublicKeyInfo ( ) const
inline

Definition at line 179 of file certificate.hpp.

References decode(), isTooEarly(), isTooLate(), m_key, and printCertificate().

◆ isTooEarly()

bool ndn::security::v1::Certificate::isTooEarly ( )

Check if the certificate is valid.

Returns
True if the current time is earlier than notBefore.

Definition at line 76 of file certificate.cpp.

References m_notBefore, and ndn::time::system_clock::now().

Referenced by getPublicKeyInfo().

◆ isTooLate()

bool ndn::security::v1::Certificate::isTooLate ( )

Check if the certificate is valid.

Returns
True if the current time is later than notAfter.

Definition at line 85 of file certificate.cpp.

References m_notAfter, and ndn::time::system_clock::now().

Referenced by getPublicKeyInfo().

◆ printCertificate()

◆ decode()

void ndn::security::v1::Certificate::decode ( )
protected

Member Data Documentation

◆ m_subjectDescriptionList

SubjectDescriptionList ndn::security::v1::Certificate::m_subjectDescriptionList
protected

◆ m_notBefore

time::system_clock::TimePoint ndn::security::v1::Certificate::m_notBefore
protected

◆ m_notAfter

time::system_clock::TimePoint ndn::security::v1::Certificate::m_notAfter
protected

Definition at line 208 of file certificate.hpp.

Referenced by decode(), encode(), getNotAfter(), isTooLate(), printCertificate(), and setNotAfter().

◆ m_key

PublicKey ndn::security::v1::Certificate::m_key
protected

Definition at line 209 of file certificate.hpp.

Referenced by decode(), encode(), getPublicKeyInfo(), printCertificate(), and setPublicKeyInfo().

◆ m_extensionList

ExtensionList ndn::security::v1::Certificate::m_extensionList
protected

Definition at line 210 of file certificate.hpp.

Referenced by addExtension(), decode(), encode(), and getExtensionList().


The documentation for this class was generated from the following files: