ndn::DigestSha256 Class Reference

Represents a signature of DigestSha256 type. More...

#include <ndn-cxx/security/digest-sha256.hpp>

+ Inheritance diagram for ndn::DigestSha256:
+ Collaboration diagram for ndn::DigestSha256:

Public Member Functions

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

Protected Attributes

SignatureInfo m_info
 
Block m_value
 

Detailed Description

Represents a signature of DigestSha256 type.

Deprecated:
Use SignatureInfo with type DigestSha256 instead

This signature type provides integrity protection using SHA-256 digest, but no provenance of a Data packet or any kind of guarantee that packet is from the original source.

Definition at line 35 of file digest-sha256.hpp.

Constructor & Destructor Documentation

◆ DigestSha256() [1/2]

ndn::DigestSha256::DigestSha256 ( )

Create empty DigestSha256 signature.

Definition at line 26 of file digest-sha256.cpp.

◆ DigestSha256() [2/2]

ndn::DigestSha256::DigestSha256 ( const Signature signature)
explicit

Convert base Signature to DigestSha256 signature.

Exceptions
Signature::ErrorSignatureType is not DigestSha256

Definition at line 31 of file digest-sha256.cpp.

Member Function Documentation

◆ getInfo()

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

Get SignatureInfo as wire format.

Definition at line 78 of file signature.hpp.

◆ getKeyLocator()

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

Get KeyLocator.

Exceptions
tlv::ErrorKeyLocator does not exist in SignatureInfo

Definition at line 130 of file signature.hpp.

◆ getSignatureInfo()

const SignatureInfo& ndn::Signature::getSignatureInfo ( ) const
inlineinherited

Get SignatureInfo.

Definition at line 70 of file signature.hpp.

◆ getType()

tlv::SignatureTypeValue ndn::Signature::getType ( ) const
inherited

Get SignatureType.

Exceptions
Errorsignature is invalid

Definition at line 43 of file signature.cpp.

◆ getValue()

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

Get SignatureValue.

Definition at line 100 of file signature.hpp.

◆ hasKeyLocator()

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

Check if KeyLocator exists in SignatureInfo.

Definition at line 121 of file signature.hpp.

◆ operator bool()

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

Determine whether SignatureInfo is valid.

Definition at line 62 of file signature.hpp.

◆ setInfo() [1/2]

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

Decode SignatureInfo from wire format.

Exceptions
tlv::Errordecode error

Definition at line 52 of file signature.cpp.

◆ setInfo() [2/2]

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

Set SignatureInfo.

Definition at line 92 of file signature.hpp.

◆ setKeyLocator()

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

Set KeyLocator.

Definition at line 138 of file signature.hpp.

◆ setValue()

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

Set SignatureValue.

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

Definition at line 58 of file signature.cpp.

◆ unsetKeyLocator()

void ndn::Signature::unsetKeyLocator ( )
inlineinherited

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 149 of file signature.hpp.

Member Data Documentation

◆ m_info

SignatureInfo ndn::Signature::m_info
protectedinherited

Definition at line 155 of file signature.hpp.

◆ m_value

Block ndn::Signature::m_value
mutableprotectedinherited

Definition at line 156 of file signature.hpp.