Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ndn::Certificate Class Reference
Inheritance diagram for ndn::Certificate:
ndn::Data ndn::IdentityCertificate

Public Member Functions

 Certificate ()
 The default constructor.
 
 Certificate (const Data &data)
 Create a Certificate from the content in the data packet. More...
 
virtual ~Certificate ()
 The virtual destructor.
 
void encode ()
 Encode the contents of the certificate in DER format and set the Content and MetaInfo fields.
 
virtual void wireDecode (const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Override to call the base class wireDecode then populate the certificate fields. More...
 
void addSubjectDescription (const CertificateSubjectDescription &description)
 Add a subject description. More...
 
const SubjectDescriptionList & getSubjectDescriptionList () const
 
SubjectDescriptionList & getSubjectDescriptionList ()
 
void addExtension (const CertificateExtension &extension)
 Add a certificate extension. More...
 
const ExtensionList & getExtensionList () const
 
ExtensionList & getExtensionList ()
 
void setNotBefore (const MillisecondsSince1970 &notBefore)
 
MillisecondsSince1970getNotBefore ()
 
const MillisecondsSince1970getNotBefore () const
 
void setNotAfter (const MillisecondsSince1970 &notAfter)
 
MillisecondsSince1970getNotAfter ()
 
const MillisecondsSince1970getNotAfter () const
 
void setPublicKeyInfo (const PublicKey &key)
 
PublicKeygetPublicKeyInfo ()
 
const PublicKeygetPublicKeyInfo () const
 
bool isTooEarly () const
 Check if the certificate is valid. More...
 
bool isTooLate () const
 Check if the certificate is valid. More...
 
void printCertificate (std::ostream &os) const
 
void printCertificate () const
 
- Public Member Functions inherited from ndn::Data
 Data ()
 Create a new Data object with default values and where the signature is a blank Sha256WithRsaSignature.
 
 Data (const Name &name)
 Create a new Data object with the given name and default values and where the signature is a blank Sha256WithRsaSignature. More...
 
 Data (const Data &data)
 The copy constructor: Create a deep copy of the given data object, including a clone of the signature object. More...
 
virtual ~Data ()
 The virtual destructor.
 
Dataoperator= (const Data &data)
 The assignment operator: Copy fields and make a clone of the signature. More...
 
SignedBlob wireEncode (WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const
 Encode this Data for a particular wire format. More...
 
void wireDecode (const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this Data. More...
 
void wireDecode (const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this Data. More...
 
void get (DataLite &dataLite) const
 Set dataLite to point to the values in this Data object, without copying any memory. More...
 
void set (const DataLite &dataLite)
 Clear this data object, and set the values by copying from dataLite. More...
 
const SignaturegetSignature () const
 
SignaturegetSignature ()
 
const NamegetName () const
 
NamegetName ()
 
const MetaInfogetMetaInfo () const
 
MetaInfogetMetaInfo ()
 
const BlobgetContent () const
 
uint64_t getIncomingFaceId () const
 Get the incoming face ID according to the incoming packet header. More...
 
const SignedBlobgetDefaultWireEncoding () const
 Return a reference to the defaultWireEncoding, which was encoded with getDefaultWireEncodingFormat(). More...
 
WireFormatgetDefaultWireEncodingFormat () const
 Get the WireFormat which is used by getDefaultWireEncoding(). More...
 
DatasetSignature (const Signature &signature)
 Set the signature to a copy of the given signature. More...
 
virtual DatasetName (const Name &name)
 Set name to a copy of the given Name. More...
 
DatasetMetaInfo (const MetaInfo &metaInfo)
 Set metaInfo to a copy of the given MetaInfo. More...
 
DatasetContent (const std::vector< uint8_t > &content)
 Set the content to a copy of the data in the vector. More...
 
DatasetContent (const uint8_t *content, size_t contentLength)
 
DatasetContent (const Blob &content)
 
DatasetLpPacket (const ptr_lib::shared_ptr< LpPacket > &lpPacket)
 An internal library method to set the LpPacket for an incoming packet. More...
 
uint64_t getChangeCount () const
 Get the change count, which is incremented each time this object (or a child object) is changed. More...
 

Protected Member Functions

void decode ()
 

Protected Attributes

SubjectDescriptionList subjectDescriptionList_
 
MillisecondsSince1970 notBefore_
 
MillisecondsSince1970 notAfter_
 
PublicKey key_
 
ExtensionList extensionList_
 

Constructor & Destructor Documentation

ndn::Certificate::Certificate ( const Data data)

Create a Certificate from the content in the data packet.

Parameters
dataThe data packet with the content to decode.

Member Function Documentation

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

Add a certificate extension.

Parameters
extensionthe extension to be added
void ndn::Certificate::addSubjectDescription ( const CertificateSubjectDescription description)
inline

Add a subject description.

Parameters
descriptionThe description to be added.
bool ndn::Certificate::isTooEarly ( ) const

Check if the certificate is valid.

Returns
True if the current time is earlier than notBefore.
bool ndn::Certificate::isTooLate ( ) const

Check if the certificate is valid.

Returns
True if the current time is later than notAfter.
void ndn::Certificate::wireDecode ( const Blob input,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
virtual

Override to call the base class wireDecode then populate the certificate fields.

Parameters
inputThe input byte array to be decoded as an immutable Blob.
wireFormatA WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat().

Reimplemented from ndn::Data.

Reimplemented in ndn::IdentityCertificate.


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