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

Holds SignatureInfo and SignatureValue in a Data packet. More...

#include <signature.hpp>

Inheritance diagram for ndn::Signature:
Collaboration diagram for ndn::Signature:

Classes

class  Error
 

Public Member Functions

 Signature ()=default
 
 Signature (const Block &info, const Block &value=Block())
 
 Signature (const SignatureInfo &info, const Block &value=Block())
 
 operator bool () const
 Determine whether SignatureInfo is valid. More...
 
const SignatureInfogetSignatureInfo () const
 Get SignatureInfo. More...
 
const BlockgetInfo () const
 Get SignatureInfo as wire format. More...
 
void setInfo (const Block &info)
 Decode SignatureInfo from wire format. More...
 
void setInfo (const SignatureInfo &info)
 Set SignatureInfo. More...
 
const BlockgetValue () const
 Get SignatureValue. More...
 
void setValue (const Block &value)
 Set SignatureValue. More...
 
tlv::SignatureTypeValue getType () const
 Get SignatureType. More...
 
bool hasKeyLocator () const
 Check if KeyLocator exists in SignatureInfo. More...
 
const KeyLocatorgetKeyLocator () const
 Get KeyLocator. More...
 
void setKeyLocator (const KeyLocator &keyLocator)
 Set KeyLocator. More...
 
void unsetKeyLocator ()
 Unset KeyLocator. More...
 

Protected Attributes

SignatureInfo m_info
 
Block m_value
 

Detailed Description

Holds SignatureInfo and SignatureValue in a Data packet.

A Signature is not a TLV element itself. It collects SignatureInfo and SignatureValue TLV elements together for easy access. In most cases, an application should use a subclass of Signature such as DigestSha256 , SignatureSha256WithRsa , or SignatureSha256WithEcdsa instead of using Signature type directly.

Definition at line 37 of file signature.hpp.

Constructor & Destructor Documentation

◆ Signature() [1/3]

ndn::Signature::Signature ( )
default

◆ Signature() [2/3]

ndn::Signature::Signature ( const Block info,
const Block value = Block() 
)
explicit

Definition at line 30 of file signature.cpp.

◆ Signature() [3/3]

ndn::Signature::Signature ( const SignatureInfo info,
const Block value = Block() 
)
explicit

Definition at line 37 of file signature.cpp.

Member Function Documentation

◆ operator bool()

ndn::Signature::operator bool ( ) const
inlineexplicit

Determine whether SignatureInfo is valid.

Definition at line 61 of file signature.hpp.

References ndn::SignatureInfo::getSignatureType(), and m_info.

◆ getSignatureInfo()

◆ getInfo()

const Block& ndn::Signature::getInfo ( ) const
inline

Get SignatureInfo as wire format.

Definition at line 77 of file signature.hpp.

References m_info, and ndn::SignatureInfo::wireEncode().

Referenced by ndn::Interest::matchesData(), and ndn::Data::wireEncode().

◆ setInfo() [1/2]

void ndn::Signature::setInfo ( const Block info)

Decode SignatureInfo from wire format.

Exceptions
tlv::Errordecode error

Definition at line 53 of file signature.cpp.

References m_info, and ndn::tlv::SignatureInfo.

Referenced by ndn::Data::wireDecode().

◆ setInfo() [2/2]

void ndn::Signature::setInfo ( const SignatureInfo info)
inline

Set SignatureInfo.

Definition at line 91 of file signature.hpp.

References m_info.

◆ getValue()

const Block& ndn::Signature::getValue ( ) const
inline

Get SignatureValue.

Definition at line 99 of file signature.hpp.

References m_value.

Referenced by ndn::operator<<(), ndn::operator==(), ndn::security::parse(), and ndn::Data::wireEncode().

◆ setValue()

void ndn::Signature::setValue ( const Block value)

Set SignatureValue.

Exceptions
tlv::ErrorTLV-TYPE of supplied block is not SignatureValue, or the block does not have TLV-VALUE

Definition at line 59 of file signature.cpp.

References m_value, ndn::tlv::SignatureValue, ndn::to_string(), and ndn::Block::type().

Referenced by ndn::Data::setSignatureValue(), and ndn::Data::wireDecode().

◆ getType()

◆ hasKeyLocator()

bool ndn::Signature::hasKeyLocator ( ) const
inline

◆ getKeyLocator()

const KeyLocator& ndn::Signature::getKeyLocator ( ) const
inline

Get KeyLocator.

Exceptions
tlv::ErrorKeyLocator does not exist in SignatureInfo

Definition at line 129 of file signature.hpp.

References ndn::SignatureInfo::getKeyLocator(), and m_info.

Referenced by ndn::security::v2::operator<<().

◆ setKeyLocator()

void ndn::Signature::setKeyLocator ( const KeyLocator keyLocator)
inline

Set KeyLocator.

Definition at line 137 of file signature.hpp.

References m_info, and ndn::SignatureInfo::setKeyLocator().

◆ unsetKeyLocator()

void ndn::Signature::unsetKeyLocator ( )
inline

Unset KeyLocator.

Note
Subclasses of Signature may provide advisory (non-virtual) override to prevent unsetting KeyLocator if it is required by the specification.

Definition at line 148 of file signature.hpp.

References m_info, and ndn::SignatureInfo::unsetKeyLocator().

Member Data Documentation

◆ m_info

SignatureInfo ndn::Signature::m_info
protected

◆ m_value

Block ndn::Signature::m_value
mutableprotected

Definition at line 155 of file signature.hpp.

Referenced by getValue(), and setValue().


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