#include <validator-regex.hpp>
Classes | |
class | Error |
Public Member Functions | |
ValidatorRegex (Face *face=nullptr, shared_ptr< CertificateCache > certificateCache=DEFAULT_CERTIFICATE_CACHE, const int stepLimit=3) | |
ValidatorRegex (Face &face, shared_ptr< CertificateCache > certificateCache=DEFAULT_CERTIFICATE_CACHE, const int stepLimit=3) | |
virtual | ~ValidatorRegex () |
void | addDataVerificationRule (shared_ptr< SecRuleRelative > rule) |
Add a rule for data verification. More... | |
void | addTrustAnchor (shared_ptr< v1::IdentityCertificate > certificate) |
Add a trust anchor. More... | |
Public Member Functions inherited from ndn::security::Validator | |
Validator (Face *face=nullptr) | |
Validator constructor. More... | |
Validator (Face &face) | |
virtual | ~Validator () |
void | validate (const Data &data, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed) |
Validate Data and call either onValidated or onValidationFailed. More... | |
void | validate (const Interest &interest, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed) |
Validate Interest and call either onValidated or onValidationFailed. More... | |
Static Public Attributes | |
static const shared_ptr< CertificateCache > | DEFAULT_CERTIFICATE_CACHE |
Protected Types | |
typedef std::vector< shared_ptr< SecRuleRelative > > | RuleList |
typedef std::vector< shared_ptr< Regex > > | RegexList |
Protected Types inherited from ndn::security::Validator | |
typedef function< void(const std::string &)> | OnFailure |
Protected Member Functions | |
virtual void | checkPolicy (const Data &data, int nSteps, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps) |
virtual void | checkPolicy (const Interest &interest, int nSteps, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps) |
void | onCertificateValidated (const shared_ptr< const Data > &signCertificate, const shared_ptr< const Data > &data, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed) |
void | onCertificateValidationFailed (const shared_ptr< const Data > &signCertificate, const std::string &failureInfo, const shared_ptr< const Data > &data, const OnDataValidationFailed &onValidationFailed) |
Protected Member Functions inherited from ndn::security::Validator | |
virtual void | checkPolicy (const Data &data, int nSteps, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest >> &nextSteps)=0 |
Check the Data against policy and return the next validation step if necessary. More... | |
virtual void | checkPolicy (const Interest &interest, int nSteps, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest >> &nextSteps)=0 |
Check the Interest against validation policy and return the next validation step if necessary. More... | |
void | onData (const Interest &interest, const Data &data, const shared_ptr< ValidationRequest > &nextStep) |
Process the received certificate. More... | |
void | validate (const Data &data, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, int nSteps) |
void | validate (const Interest &interest, const OnInterestValidated &onValidated, const OnInterestValidationFailed &onValidationFailed, int nSteps) |
virtual shared_ptr< const Data > | preCertificateValidation (const Data &data) |
Hooks. More... | |
virtual void | onNack (const Interest &interest, const lp::Nack &nack, int nRemainingRetries, const OnFailure &onFailure, const shared_ptr< ValidationRequest > &validationRequest) |
trigger when interest retrieves a Nack. More... | |
virtual void | onTimeout (const Interest &interest, int nRemainingRetries, const OnFailure &onFailure, const shared_ptr< ValidationRequest > &validationRequest) |
trigger when interest for certificate times out. More... | |
virtual void | afterCheckPolicy (const std::vector< shared_ptr< ValidationRequest >> &nextSteps, const OnFailure &onFailure) |
trigger after checkPolicy is done. More... | |
Protected Attributes | |
int | m_stepLimit |
shared_ptr< CertificateCache > | m_certificateCache |
RuleList | m_mustFailVerify |
RuleList | m_verifyPolicies |
std::map< Name, shared_ptr< v1::IdentityCertificate > > | m_trustAnchors |
Protected Attributes inherited from ndn::security::Validator | |
Face * | m_face |
Additional Inherited Members | |
Static Public Member Functions inherited from ndn::security::Validator | |
static bool | verifySignature (const Data &data, const v1::PublicKey &publicKey) |
Verify the data using the publicKey. More... | |
static bool | verifySignature (const Interest &interest, const v1::PublicKey &publicKey) |
Verify the signed Interest using the publicKey. More... | |
static bool | verifySignature (const Buffer &blob, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the blob using the publicKey against the signature. More... | |
static bool | verifySignature (const Data &data, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the data using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const Interest &interest, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the interest using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const uint8_t *buf, const size_t size, const Signature &sig, const v1::PublicKey &publicKey) |
Verify the blob using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const Data &data, const DigestSha256 &sig) |
Verify the data against the SHA256 signature. More... | |
static bool | verifySignature (const Interest &interest, const DigestSha256 &sig) |
Verify the interest against the SHA256 signature. More... | |
static bool | verifySignature (const Buffer &blob, const DigestSha256 &sig) |
Verify the blob against the SHA256 signature. More... | |
static bool | verifySignature (const uint8_t *buf, const size_t size, const DigestSha256 &sig) |
Verify the blob against the SHA256 signature. More... | |
Definition at line 36 of file validator-regex.hpp.
|
protected |
Definition at line 119 of file validator-regex.hpp.
|
protected |
Definition at line 120 of file validator-regex.hpp.
|
explicit |
Definition at line 35 of file validator-regex.cpp.
References ndn::Face::getIoService(), and m_certificateCache.
Referenced by ndn::security::ValidatorRegex::Error::Error().
|
explicit |
Definition at line 46 of file validator-regex.cpp.
References ndn::Face::getIoService(), and m_certificateCache.
|
inlinevirtual |
Definition at line 65 of file validator-regex.hpp.
References addDataVerificationRule(), addTrustAnchor(), and checkPolicy().
void ndn::security::ValidatorRegex::addDataVerificationRule | ( | shared_ptr< SecRuleRelative > | rule | ) |
Add a rule for data verification.
rule | The verification rule |
Definition at line 58 of file validator-regex.cpp.
References m_mustFailVerify, and m_verifyPolicies.
Referenced by ~ValidatorRegex().
void ndn::security::ValidatorRegex::addTrustAnchor | ( | shared_ptr< v1::IdentityCertificate > | certificate | ) |
Add a trust anchor.
certificate | The trust anchor |
Definition at line 64 of file validator-regex.cpp.
References m_trustAnchors.
Referenced by ~ValidatorRegex().
|
protectedvirtual |
Definition at line 107 of file validator-regex.cpp.
References ndn::Signature::getKeyLocator(), ndn::KeyLocator::getName(), ndn::Data::getName(), ndn::Data::getSignature(), ndn::KeyLocator::getType(), ndn::Signature::hasKeyLocator(), ndn::KeyLocator::KeyLocator_Name, m_certificateCache, m_mustFailVerify, m_stepLimit, m_trustAnchors, m_verifyPolicies, onCertificateValidated(), onCertificateValidationFailed(), ndn::Name::toUri(), and ndn::security::Validator::verifySignature().
Referenced by ~ValidatorRegex().
|
inlineprotectedvirtual |
Definition at line 94 of file validator-regex.hpp.
References onCertificateValidated(), and onCertificateValidationFailed().
|
protected |
Definition at line 70 of file validator-regex.cpp.
References m_certificateCache, and ndn::security::Validator::verifySignature().
Referenced by checkPolicy().
|
protected |
Definition at line 98 of file validator-regex.cpp.
Referenced by checkPolicy().
|
static |
Definition at line 116 of file validator-regex.hpp.
Referenced by ndn::security::ValidatorRegex::Error::Error().
|
protected |
Definition at line 122 of file validator-regex.hpp.
Referenced by checkPolicy().
|
protected |
Definition at line 123 of file validator-regex.hpp.
Referenced by checkPolicy(), onCertificateValidated(), and ValidatorRegex().
|
protected |
Definition at line 124 of file validator-regex.hpp.
Referenced by addDataVerificationRule(), and checkPolicy().
|
protected |
Definition at line 125 of file validator-regex.hpp.
Referenced by addDataVerificationRule(), and checkPolicy().
|
protected |
Definition at line 126 of file validator-regex.hpp.
Referenced by addTrustAnchor(), and checkPolicy().