31 if (innerPolicy ==
nullptr) {
32 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Inner policy argument cannot be nullptr"));
35 if (m_validator !=
nullptr) {
36 innerPolicy->setValidator(*m_validator);
56 m_validator = &validator;
66 state.
fail({ValidationError::Code::INVALID_KEY_LOCATOR,
"KeyLocator is missing"});
72 state.
fail({ValidationError::Code::INVALID_KEY_LOCATOR,
"KeyLocator type is not Name"});
91 "Invalid signed Interest: name too short"});
100 state.
fail({ValidationError::Code::INVALID_KEY_LOCATOR,
101 "Invalid signed Interest: " + std::string(e.what())});
void setInnerPolicy(unique_ptr< ValidationPolicy > innerPolicy)
Set inner policy.
Copyright (c) 2011-2015 Regents of the University of California.
const KeyLocator & getKeyLocator() const
Get KeyLocator.
Represents a SignatureInfo TLV element.
void setValidator(Validator &validator)
Set validator to which the policy is associated.
const Name & getName() const
get Name element
const size_t MIN_SIZE
minimal number of components for Signed Interest
Represents an Interest packet.
ValidationPolicy & getInnerPolicy()
Return the inner policy.
indicates KeyLocator contains a Name
Abstraction that implements validation policy for Data and Interest packets.
unique_ptr< ValidationPolicy > m_innerPolicy
const Signature & getSignature() const
Get Signature.
static Name getKeyLocatorName(const SignatureInfo &si, ValidationState &state)
bool hasKeyLocator() const
Check if KeyLocator exists.
Represents an absolute name.
void wireDecode(const Block &wire)
Decode from wire format.
const ssize_t POS_SIG_INFO
virtual void fail(const ValidationError &error)=0
Call the failure callback.
const SignatureInfo & getSignatureInfo() const
Get SignatureInfo.
Represents a Data packet.
represents an error in TLV encoding or decoding
Interface for validating data and interest packets.
const Name & getName() const