Represents a SignatureInfo TLV element. More...
#include <signature-info.hpp>
Classes | |
class | Error |
Public Member Functions | |
SignatureInfo () | |
Create an invalid SignatureInfo. More... | |
SignatureInfo (tlv::SignatureTypeValue type) | |
Create with specified type. More... | |
SignatureInfo (tlv::SignatureTypeValue type, const KeyLocator &keyLocator) | |
Create with specified type and KeyLocator. More... | |
SignatureInfo (const Block &wire) | |
Create from wire encoding. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Encode to wire format. More... | |
void | wireDecode (const Block &wire) |
Decode from wire format. More... | |
int32_t | getSignatureType () const |
Get SignatureType. More... | |
void | setSignatureType (tlv::SignatureTypeValue type) |
Set SignatureType. More... | |
bool | hasKeyLocator () const |
Check if KeyLocator exists. More... | |
const KeyLocator & | getKeyLocator () const |
Get KeyLocator. More... | |
void | setKeyLocator (const KeyLocator &keyLocator) |
Set KeyLocator. More... | |
void | unsetKeyLocator () |
Unset KeyLocator. More... | |
security::ValidityPeriod | getValidityPeriod () const |
Get ValidityPeriod. More... | |
void | setValidityPeriod (const security::ValidityPeriod &validityPeriod) |
Set ValidityPeriod. More... | |
void | unsetValidityPeriod () |
Unset ValidityPeriod. More... | |
const Block & | getTypeSpecificTlv (uint32_t type) const |
Get SignatureType-specific sub-element. More... | |
void | appendTypeSpecificTlv (const Block &element) |
Append SignatureType-specific sub-element. More... | |
Friends | |
bool | operator== (const SignatureInfo &lhs, const SignatureInfo &rhs) |
std::ostream & | operator<< (std::ostream &os, const SignatureInfo &info) |
Represents a SignatureInfo TLV element.
Definition at line 33 of file signature-info.hpp.
ndn::SignatureInfo::SignatureInfo | ( | ) |
Create an invalid SignatureInfo.
Definition at line 35 of file signature-info.cpp.
Referenced by ndn::SignatureInfo::Error::Error().
|
explicit |
Create with specified type.
Definition at line 41 of file signature-info.cpp.
ndn::SignatureInfo::SignatureInfo | ( | tlv::SignatureTypeValue | type, |
const KeyLocator & | keyLocator | ||
) |
Create with specified type and KeyLocator.
Definition at line 47 of file signature-info.cpp.
|
explicit |
Create from wire encoding.
tlv::Error | decode error |
Definition at line 54 of file signature-info.cpp.
References wireDecode().
size_t ndn::SignatureInfo::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
encoder | EncodingEstimator or EncodingBuffer instance |
Definition at line 61 of file signature-info.cpp.
References ndn::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(), ndn::encoding::prependNonNegativeIntegerBlock(), ndn::tlv::SignatureInfo, ndn::tlv::SignatureType, and ndn::KeyLocator::wireEncode().
Referenced by ndn::Signature::getInfo(), and ndn::security::v2::KeyChain::sign().
const Block & ndn::SignatureInfo::wireEncode | ( | ) | const |
Encode to wire format.
Definition at line 92 of file signature-info.cpp.
References ndn::Block::hasWire().
Referenced by ndn::SignatureInfo::Error::Error().
void ndn::SignatureInfo::wireDecode | ( | const Block & | wire | ) |
Decode from wire format.
tlv::Error | decode error |
Definition at line 108 of file signature-info.cpp.
References ndn::Block::elements_begin(), ndn::Block::elements_end(), ndn::tlv::KeyLocator, ndn::Block::parse(), ndn::tlv::SignatureInfo, ndn::tlv::SignatureType, ndn::to_string(), ndn::Block::type(), and ndn::KeyLocator::wireDecode().
Referenced by ndn::SignatureInfo::Error::Error(), ndn::security::v2::getKeyLocatorName(), and SignatureInfo().
|
inline |
Get SignatureType.
Definition at line 88 of file signature-info.hpp.
References setSignatureType().
Referenced by ndn::Signature::getType(), ndn::Signature::operator bool(), and ndn::operator<<().
void ndn::SignatureInfo::setSignatureType | ( | tlv::SignatureTypeValue | type | ) |
Set SignatureType.
Definition at line 144 of file signature-info.cpp.
References ndn::Block::reset().
Referenced by getSignatureType(), and ndn::security::v2::parseLocatorUri().
|
inline |
Check if KeyLocator exists.
Definition at line 101 of file signature-info.hpp.
References appendTypeSpecificTlv(), getKeyLocator(), getTypeSpecificTlv(), getValidityPeriod(), ndn::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(), operator<<, operator==, setKeyLocator(), setValidityPeriod(), unsetKeyLocator(), and unsetValidityPeriod().
Referenced by ndn::security::v2::getKeyLocatorName(), ndn::Signature::hasKeyLocator(), and ndn::operator<<().
const KeyLocator & ndn::SignatureInfo::getKeyLocator | ( | ) | const |
Get KeyLocator.
Error | KeyLocator does not exist |
Definition at line 151 of file signature-info.cpp.
Referenced by ndn::Signature::getKeyLocator(), ndn::security::v2::getKeyLocatorName(), hasKeyLocator(), and ndn::operator<<().
void ndn::SignatureInfo::setKeyLocator | ( | const KeyLocator & | keyLocator | ) |
Set KeyLocator.
Definition at line 160 of file signature-info.cpp.
References ndn::Block::reset().
Referenced by hasKeyLocator(), ndn::security::v2::parseLocatorUri(), and ndn::Signature::setKeyLocator().
void ndn::SignatureInfo::unsetKeyLocator | ( | ) |
Unset KeyLocator.
Definition at line 168 of file signature-info.cpp.
References ndn::tlv::KeyLocator, and ndn::Block::reset().
Referenced by hasKeyLocator(), and ndn::Signature::unsetKeyLocator().
security::ValidityPeriod ndn::SignatureInfo::getValidityPeriod | ( | ) | const |
Get ValidityPeriod.
Error | ValidityPeriod does not exist |
Definition at line 176 of file signature-info.cpp.
References ndn::tlv::ValidityPeriod.
Referenced by ndn::security::v2::Certificate::getValidityPeriod(), hasKeyLocator(), and ndn::security::v2::Certificate::isValid().
void ndn::SignatureInfo::setValidityPeriod | ( | const security::ValidityPeriod & | validityPeriod | ) |
Set ValidityPeriod.
Definition at line 186 of file signature-info.cpp.
References unsetValidityPeriod(), and ndn::security::ValidityPeriod::wireEncode().
Referenced by hasKeyLocator(), and ndn::security::v2::parseLocatorUri().
void ndn::SignatureInfo::unsetValidityPeriod | ( | ) |
Unset ValidityPeriod.
Definition at line 193 of file signature-info.cpp.
References ndn::Block::reset(), and ndn::tlv::ValidityPeriod.
Referenced by hasKeyLocator(), and setValidityPeriod().
const Block & ndn::SignatureInfo::getTypeSpecificTlv | ( | uint32_t | type | ) | const |
Get SignatureType-specific sub-element.
type | TLV-TYPE of sub-element |
Error | sub-element of specified type does not exist |
Definition at line 202 of file signature-info.cpp.
References ndn::to_string().
Referenced by ndn::security::v2::Certificate::getExtension(), hasKeyLocator(), and ndn::security::v2::operator<<().
void ndn::SignatureInfo::appendTypeSpecificTlv | ( | const Block & | element | ) |
Append SignatureType-specific sub-element.
Definition at line 213 of file signature-info.cpp.
References ndn::Block::reset().
Referenced by hasKeyLocator().
|
friend |
Definition at line 220 of file signature-info.cpp.
Referenced by hasKeyLocator().
|
friend |
Definition at line 229 of file signature-info.cpp.
Referenced by hasKeyLocator(), and ndn::operator!=().