#include <key-locator.hpp>
Classes | |
class | Error |
Public Types | |
enum | Type { KeyLocator_None = 65535, KeyLocator_Name = 0, KeyLocator_KeyDigest = 1, KeyLocator_Unknown = 255 } |
Public Member Functions | |
KeyLocator () | |
construct an empty KeyLocator More... | |
KeyLocator (const Block &wire) | |
construct from wire encoding More... | |
KeyLocator (const Name &name) | |
construct from Name More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
prepend wire encoding More... | |
const Block & | wireEncode () const |
void | wireDecode (const Block &wire) |
decode from wire encoding More... | |
bool | empty () const |
Type | getType () const |
KeyLocator & | clear () |
clear KeyLocator More... | |
const Name & | getName () const |
get Name element More... | |
KeyLocator & | setName (const Name &name) |
set Name element More... | |
const Block & | getKeyDigest () const |
get KeyDigest element More... | |
KeyLocator & | setKeyDigest (const Block &keyDigest) |
set KeyDigest element More... | |
KeyLocator & | setKeyDigest (const ConstBufferPtr &keyDigest) |
set KeyDigest value More... | |
bool | operator== (const KeyLocator &other) const |
bool | operator!= (const KeyLocator &other) const |
Definition at line 30 of file key-locator.hpp.
Enumerator | |
---|---|
KeyLocator_None |
indicates KeyLocator is empty (internal use only) |
KeyLocator_Name |
indicates KeyLocator contains a Name |
KeyLocator_KeyDigest |
indicates KeyLocator contains a KeyDigest |
KeyLocator_Unknown |
indicates KeyLocator contains an unknown element |
Definition at line 43 of file key-locator.hpp.
ndn::KeyLocator::KeyLocator | ( | ) |
construct an empty KeyLocator
Definition at line 34 of file key-locator.cpp.
|
explicit |
construct from wire encoding
Definition at line 39 of file key-locator.cpp.
References wireDecode().
ndn::KeyLocator::KeyLocator | ( | const Name & | name | ) |
construct from Name
Definition at line 44 of file key-locator.cpp.
References setName().
size_t ndn::KeyLocator::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
prepend wire encoding
encoder | EncodingBuffer or Estimator |
Definition at line 51 of file key-locator.cpp.
References ndn::tlv::KeyLocator, KeyLocator_KeyDigest, KeyLocator_Name, KeyLocator_None, and ndn::Name::wireEncode().
Referenced by ndn::Interest::matchesData(), operator==(), ndn::Selectors::wireEncode(), and ndn::SignatureInfo::wireEncode().
const Block & ndn::KeyLocator::wireEncode | ( | ) | const |
Definition at line 83 of file key-locator.cpp.
References ndn::Block::hasWire().
Referenced by operator==().
void ndn::KeyLocator::wireDecode | ( | const Block & | wire | ) |
decode from wire encoding
Error | outer TLV type is not KeyLocator |
Definition at line 99 of file key-locator.cpp.
References ndn::Block::elements(), ndn::Block::elements_begin(), ndn::tlv::KeyDigest, ndn::tlv::KeyLocator, KeyLocator_KeyDigest, KeyLocator_Name, KeyLocator_None, KeyLocator_Unknown, ndn::tlv::Name, ndn::Block::parse(), ndn::Block::type(), and ndn::Name::wireDecode().
Referenced by KeyLocator(), ndn::Selectors::wireDecode(), and ndn::SignatureInfo::wireDecode().
|
inline |
Definition at line 95 of file key-locator.hpp.
References KeyLocator_None.
Referenced by ndn::Selectors::empty(), and ndn::Interest::matchesData().
|
inline |
Definition at line 101 of file key-locator.hpp.
References clear(), getKeyDigest(), getName(), operator==(), setKeyDigest(), and setName().
Referenced by ndn::ValidatorRegex::checkPolicy(), ndn::ValidatorConfig::checkPolicy(), ndn::CommandInterestValidator::checkPolicy(), ndn::SecRuleSpecific::matchSignerName(), ndn::SecRuleRelative::matchSignerName(), ndn::Certificate::printCertificate(), and ndn::SecRuleRelative::satisfy().
KeyLocator & ndn::KeyLocator::clear | ( | ) |
clear KeyLocator
type becomes KeyLocator_None
Definition at line 128 of file key-locator.cpp.
References ndn::Name::clear(), KeyLocator_None, and ndn::Block::reset().
Referenced by getType(), setKeyDigest(), and setName().
const Name & ndn::KeyLocator::getName | ( | ) | const |
get Name element
Error | if type is not KeyLocator_Name |
Definition at line 138 of file key-locator.cpp.
References KeyLocator_Name.
Referenced by ndn::SecPublicInfoSqlite3::addCertificate(), ndn::security::conf::RelationKeyLocatorNameChecker::check(), ndn::security::conf::RegexKeyLocatorNameChecker::check(), ndn::security::conf::HyperKeyLocatorNameChecker::check(), ndn::security::conf::FixedSignerChecker::check(), ndn::ValidatorRegex::checkPolicy(), ndn::ValidatorConfig::checkPolicy(), ndn::CommandInterestValidator::checkPolicy(), getType(), ndn::SecRuleSpecific::matchSignerName(), ndn::SecRuleRelative::matchSignerName(), ndn::Certificate::printCertificate(), and ndn::SecRuleRelative::satisfy().
KeyLocator & ndn::KeyLocator::setName | ( | const Name & | name | ) |
set Name element
type becomes KeyLocator_Name
Definition at line 147 of file key-locator.cpp.
References clear(), and KeyLocator_Name.
Referenced by getType(), and KeyLocator().
const Block & ndn::KeyLocator::getKeyDigest | ( | ) | const |
get KeyDigest element
Error | if type is not KeyLocator_KeyDigest |
Definition at line 156 of file key-locator.cpp.
References KeyLocator_KeyDigest.
Referenced by getType().
KeyLocator & ndn::KeyLocator::setKeyDigest | ( | const Block & | keyDigest | ) |
set KeyDigest element
type becomes KeyLocator_KeyDigest
Definition at line 165 of file key-locator.cpp.
References clear(), ndn::tlv::KeyDigest, KeyLocator_KeyDigest, and ndn::Block::type().
Referenced by getType(), and setKeyDigest().
KeyLocator & ndn::KeyLocator::setKeyDigest | ( | const ConstBufferPtr & | keyDigest | ) |
set KeyDigest value
type becomes KeyLocator_KeyDigest
Definition at line 177 of file key-locator.cpp.
References ndn::tlv::KeyDigest, ndn::encoding::makeBinaryBlock(), and setKeyDigest().
bool ndn::KeyLocator::operator== | ( | const KeyLocator & | other | ) | const |
Definition at line 187 of file key-locator.cpp.
References wireEncode().
Referenced by getType(), and operator!=().
|
inline |
Definition at line 152 of file key-locator.hpp.
References operator==().