32 if (innerPolicy ==
nullptr) {
33 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Inner policy argument cannot be nullptr"));
36 if (m_validator !=
nullptr) {
37 innerPolicy->setValidator(*m_validator);
57 m_validator = &validator;
71 state.
fail({ValidationError::Code::INVALID_KEY_LOCATOR,
"KeyLocator is missing"});
77 state.
fail({ValidationError::Code::INVALID_KEY_LOCATOR,
"KeyLocator type is not Name"});
96 "Invalid signed Interest: name too short"});
105 state.
fail({ValidationError::Code::INVALID_KEY_LOCATOR,
106 "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.
int32_t getSignatureType() const
Get SignatureType.
static const Name & getDigestSha256Identity()
A localhost identity to indicate that the signature is generated using SHA-256.
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