32 if (innerPolicy ==
nullptr) {
33 NDN_THROW(std::invalid_argument(
"Inner policy argument cannot be nullptr"));
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.
const Name & getName() const
Represents a SignatureInfo TLV element.
void setValidator(Validator &validator)
Set validator to which the policy is associated.
const Signature & getSignature() const
Get Signature.
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.
const KeyLocator & getKeyLocator() const
Get KeyLocator.
unique_ptr< ValidationPolicy > m_innerPolicy
const SignatureInfo & getSignatureInfo() const
Get SignatureInfo.
const Name & getName() const
get Name element
static Name getKeyLocatorName(const SignatureInfo &si, ValidationState &state)
Block blockFromValue() const
size_t size() const
Get number of components.
static const Name & getDigestSha256Identity()
A localhost identity to indicate that the signature is generated using SHA-256.
Represents an absolute name.
const Component & at(ssize_t i) const
Get the component at the given index.
void wireDecode(const Block &wire)
Decode from wire format.
const ssize_t POS_SIG_INFO
bool hasKeyLocator() const
Check if KeyLocator exists.
int32_t getSignatureType() const
Get SignatureType.
virtual void fail(const ValidationError &error)=0
Call the failure callback.
Represents a Data packet.
represents an error in TLV encoding or decoding
Interface for validating data and interest packets.