Public Member Functions | List of all members
ndn::GenericSignature Class Reference

A GenericSignature extends Signature and holds the encoding bytes of the SignatureInfo so that the application can process experimental signature types. More...

#include <generic-signature.hpp>

Inheritance diagram for ndn::GenericSignature:
ndn::Signature

Public Member Functions

 GenericSignature ()
 Create a new GenericSignature with default values.
 
virtual ptr_lib::shared_ptr< Signatureclone () const
 Return a pointer to a new DigestSha256Signature which is a copy of this GenericSignature. More...
 
virtual void get (SignatureLite &signatureLite) const
 Set signatureLite to point to the values in this signature object, without copying any memory. More...
 
virtual void set (const SignatureLite &signatureLite)
 Clear this signature, and set the values by copying from signatureLite. More...
 
const BlobgetSignatureInfoEncoding () const
 Get the bytes of the entire signature info encoding (including the type code). More...
 
void setSignatureInfoEncoding (const Blob &signatureInfoEncoding, int typeCode=-1)
 Set the bytes of the entire signature info encoding (including the type code). More...
 
virtual const BlobgetSignature () const
 Get the signature bytes. More...
 
virtual void setSignature (const Blob &signature)
 Set the signature bytes to the given value. More...
 
int getTypeCode () const
 Get the type code of the signature type. More...
 
void clear ()
 Clear all the fields.
 
virtual uint64_t getChangeCount () const
 Get the change count, which is incremented each time this object is changed. More...
 
- Public Member Functions inherited from ndn::Signature
virtual ~Signature ()
 The virtual destructor.
 

Detailed Description

A GenericSignature extends Signature and holds the encoding bytes of the SignatureInfo so that the application can process experimental signature types.

When decoding a packet, if the type of SignatureInfo is not recognized, the library creates a GenericSignature.

Member Function Documentation

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

Return a pointer to a new DigestSha256Signature which is a copy of this GenericSignature.

Returns
A new GenericSignature.

Implements ndn::Signature.

void ndn::GenericSignature::get ( SignatureLite signatureLite) const
virtual

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

WARNING: The resulting pointers in signatureLite are invalid after a further use of this object which could reallocate memory.

Parameters
signatureLiteA SignatureLite object where the name components array is already allocated.

Implements ndn::Signature.

uint64_t ndn::GenericSignature::getChangeCount ( ) const
virtual

Get the change count, which is incremented each time this object is changed.

Returns
The change count.

Implements ndn::Signature.

const Blob & ndn::GenericSignature::getSignature ( ) const
virtual

Get the signature bytes.

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

Implements ndn::Signature.

const Blob& ndn::GenericSignature::getSignatureInfoEncoding ( ) const
inline

Get the bytes of the entire signature info encoding (including the type code).

Returns
The encoding bytes. If not specified, the value isNull().
int ndn::GenericSignature::getTypeCode ( ) const
inline

Get the type code of the signature type.

When wire decode calls setSignatureInfoEncoding, it sets the type code. Note that the type code is ignored during wire encode, which simply uses getSignatureInfoEncoding() where the encoding already has the type code.

Returns
The type code, or -1 if not known.
void ndn::GenericSignature::set ( const SignatureLite signatureLite)
virtual

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

Parameters
signatureLiteA SignatureLite object.

Implements ndn::Signature.

void ndn::GenericSignature::setSignature ( const Blob signature)
virtual

Set the signature bytes to the given value.

Parameters
signatureA Blob with the signature bytes.

Implements ndn::Signature.

void ndn::GenericSignature::setSignatureInfoEncoding ( const Blob signatureInfoEncoding,
int  typeCode = -1 
)
inline

Set the bytes of the entire signature info encoding (including the type code).

Parameters
signatureInfoEncodingA Blob with the encoding bytes.
typeCode(optional) The type code of the signature type, or -1 if not known. (When a GenericSignature is created by wire decoding, it sets the typeCode.)

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