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

A SignatureLite holds a signature type, a KeyLocatorLite, the signature bytes and other fields to represent the Signature block of a Data packet. More...

#include <signature-lite.hpp>

Inheritance diagram for ndn::SignatureLite:
ndn_Signature

Public Member Functions

 SignatureLite (ndn_NameComponent *keyNameComponents, size_t maxKeyNameComponents)
 Create a SignatureLite with values for none and the default digestAlgorithm. More...
 
void clear ()
 Set the fields the values for none as in the constructor.
 
ndn_SignatureType getType () const
 
const BlobLitegetDigestAlgorithm () const
 
const BlobLitegetWitness () const
 
const BlobLitegetSignature () const
 
const KeyLocatorLitegetKeyLocator () const
 
KeyLocatorLitegetKeyLocator ()
 
void setType (ndn_SignatureType type)
 
void setDigestAlgorithm (const BlobLite &digestAlgorithm)
 Set the bytes of the digest algorithm. More...
 
void setWitness (const BlobLite &witness)
 Set the witness. More...
 
void setSignature (const BlobLite &signature)
 Set the signature bytes. More...
 
ndn_Error set (const SignatureLite &other)
 Set this signature to have the values from the other signature. More...
 

Static Public Member Functions

static SignatureLiteupCast (ndn_Signature &signature)
 Upcast the reference to the ndn_Signature struct to a SignatureLite. More...
 
static const SignatureLiteupCast (const ndn_Signature &signature)
 

Detailed Description

A SignatureLite holds a signature type, a KeyLocatorLite, the signature bytes and other fields to represent the Signature block of a Data packet.

This has the union of fields needed to represent specific types of signature such as Sha256WithRsaSignature and DigestSha256Signature.

Constructor & Destructor Documentation

ndn::SignatureLite::SignatureLite ( ndn_NameComponent keyNameComponents,
size_t  maxKeyNameComponents 
)

Create a SignatureLite with values for none and the default digestAlgorithm.

Parameters
keyNameComponentsThe pre-allocated array of ndn_NameComponent for the keyLocatorLite. Instead of an array of NameLite::Component, this is an array of the underlying ndn_NameComponent struct so that it doesn't run the default constructor unnecessarily.
maxKeyNameComponentsThe number of elements in the allocated keyNameComponents array.

Member Function Documentation

ndn_Error ndn::SignatureLite::set ( const SignatureLite other)

Set this signature to have the values from the other signature.

Parameters
otherThe other SignatureLite to get values from.
Returns
0 for success, or an error code if there is not enough room in this object's key locator keyName components array.
void ndn::SignatureLite::setDigestAlgorithm ( const BlobLite digestAlgorithm)
inline

Set the bytes of the digest algorithm.

Parameters
digestAlgorithmThe bytes of the digest algorithm. This copies a pointer to the bytes, but does not copy the bytes.
void ndn::SignatureLite::setSignature ( const BlobLite signature)
inline

Set the signature bytes.

Parameters
signatureThe signature bytes. This copies a pointer to the bytes, but does not copy the bytes.
void ndn::SignatureLite::setWitness ( const BlobLite witness)
inline

Set the witness.

Parameters
witnessThe witness. This copies a pointer to the bytes, but does not copy the bytes.
static SignatureLite& ndn::SignatureLite::upCast ( ndn_Signature signature)
inlinestatic

Upcast the reference to the ndn_Signature struct to a SignatureLite.

Parameters
signatureA reference to the ndn_Signature struct.
Returns
The same reference as SignatureLite.

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