Public Member Functions | List of all members
ndn::Signature Class Referenceabstract

A Signature is an abstract base class providing methods to work with the signature information in a Data packet. More...

#include <signature.hpp>

Inheritance diagram for ndn::Signature:
ndn::DigestSha256Signature ndn::Sha256WithEcdsaSignature ndn::Sha256WithRsaSignature

Public Member Functions

virtual ~Signature ()
 The virtual destructor.
 
virtual ptr_lib::shared_ptr< Signatureclone () const =0
 Return a pointer to a new Signature which is a copy of this signature. More...
 
virtual const BlobgetSignature () const =0
 Get the signature bytes. More...
 
virtual void setSignature (const Blob &signature)=0
 Set the signature bytes to the given value. More...
 
virtual void get (struct ndn_Signature &signatureStruct) const =0
 Set the signatureStruct to point to the values in this signature object, without copying any memory. More...
 
virtual void set (const struct ndn_Signature &signatureStruct)=0
 Clear this signature, and set the values by copying from the ndn_Signature struct. More...
 
virtual uint64_t getChangeCount () const =0
 Get the change count, which is incremented each time this object (or a child object) is changed. More...
 

Detailed Description

A Signature is an abstract base class providing methods to work with the signature information in a Data packet.

You must create an object of a subclass, for example Sha256WithRsaSignature.

Member Function Documentation

virtual ptr_lib::shared_ptr<Signature> ndn::Signature::clone ( ) const
pure virtual

Return a pointer to a new Signature which is a copy of this signature.

This is pure virtual, the subclass must implement it.

Implemented in ndn::Sha256WithEcdsaSignature, ndn::Sha256WithRsaSignature, and ndn::DigestSha256Signature.

virtual void ndn::Signature::get ( struct ndn_Signature & signatureStruct  ) const
pure virtual

Set the signatureStruct to point to the values in this signature object, without copying any memory.

WARNING: The resulting pointers in signatureStruct are invalid after a further use of this object which could reallocate memory. This is pure virtual, the subclass must implement it.

Parameters
signatureStructa C ndn_Signature struct where the name components array is already allocated.

Implemented in ndn::Sha256WithEcdsaSignature, ndn::DigestSha256Signature, and ndn::Sha256WithRsaSignature.

virtual uint64_t ndn::Signature::getChangeCount ( ) const
pure virtual

Get the change count, which is incremented each time this object (or a child object) is changed.

Returns
The change count.

Implemented in ndn::Sha256WithRsaSignature, ndn::Sha256WithEcdsaSignature, and ndn::DigestSha256Signature.

virtual const Blob& ndn::Signature::getSignature ( ) const
pure virtual

Get the signature bytes.

Returns
The signature bytes. If not specified, the value isNull().

Implemented in ndn::Sha256WithRsaSignature, ndn::Sha256WithEcdsaSignature, and ndn::DigestSha256Signature.

virtual void ndn::Signature::set ( const struct ndn_Signature & signatureStruct  )
pure virtual

Clear this signature, and set the values by copying from the ndn_Signature struct.

This is pure virtual, the subclass must implement it.

Parameters
signatureStructa C ndn_Signature struct

Implemented in ndn::Sha256WithEcdsaSignature, ndn::DigestSha256Signature, and ndn::Sha256WithRsaSignature.

virtual void ndn::Signature::setSignature ( const Blob signature)
pure virtual

Set the signature bytes to the given value.

Parameters
signatureA Blob with the signature bytes.

Implemented in ndn::Sha256WithRsaSignature, ndn::Sha256WithEcdsaSignature, and ndn::DigestSha256Signature.


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