#include <validator-regex.hpp>
Data Structures | |
| class | Error |
Public Member Functions | |
| ValidatorRegex (Face &face, shared_ptr< CertificateCache > certificateCache=DEFAULT_CERTIFICATE_CACHE, const int stepLimit=3) | |
| ValidatorRegex (const shared_ptr< 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< IdentityCertificate > certificate) |
| Add a trust anchor. More... | |
| 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 Member Functions | |
| static bool | verifySignature (const Data &data, const PublicKey &publicKey) |
| Verify the data using the publicKey. More... | |
| static bool | verifySignature (const Interest &interest, const PublicKey &publicKey) |
| Verify the signed Interest using the publicKey. More... | |
| static bool | verifySignature (const Buffer &blob, const Signature &sig, const PublicKey &publicKey) |
| Verify the blob using the publicKey against the signature. More... | |
| static bool | verifySignature (const Data &data, const SignatureSha256WithRsa &sig, const PublicKey &publicKey) |
| Verify the data using the publicKey against the SHA256-RSA signature. More... | |
| static bool | verifySignature (const Interest &interest, const SignatureSha256WithRsa &sig, const PublicKey &publicKey) |
| Verify the interest using the publicKey against the SHA256-RSA signature. More... | |
| static bool | verifySignature (const Buffer &blob, const SignatureSha256WithRsa &sig, const PublicKey &publicKey) |
| Verify the blob using the publicKey against the SHA256-RSA signature. More... | |
| static bool | verifySignature (const uint8_t *buf, const size_t size, const SignatureSha256WithRsa &sig, const PublicKey &publicKey) |
| Verify the blob using the publicKey against the SHA256-RSA signature. More... | |
| static bool | verifySignature (const Data &data, const SignatureSha256 &sig) |
| Verify the data against the SHA256 signature. More... | |
| static bool | verifySignature (const Interest &interest, const SignatureSha256 &sig) |
| Verify the interest against the SHA256 signature. More... | |
| static bool | verifySignature (const Buffer &blob, const SignatureSha256 &sig) |
| Verify the blob against the SHA256 signature. More... | |
| static bool | verifySignature (const uint8_t *buf, const size_t size, const SignatureSha256 &sig) |
| Verify the blob against the SHA256 signature. 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 Member Functions | |
| virtual void | checkPolicy (const Data &data, int nSteps, const OnDataValidated &onValidated, const OnDataValidationFailed &onValidationFailed, std::vector< shared_ptr< ValidationRequest > > &nextSteps) |
| 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) |
| Check the Interest against validation policy and return the next validation step if necessary. More... | |
| 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 Attributes | |
| int | m_stepLimit |
| shared_ptr< CertificateCache > | m_certificateCache |
| RuleList | m_mustFailVerify |
| RuleList | m_verifyPolicies |
| std::map< Name, shared_ptr < IdentityCertificate > > | m_trustAnchors |
| bool | m_hasFace |
| Face & | m_face |
Definition at line 19 of file validator-regex.hpp.
|
protected |
Definition at line 98 of file validator-regex.hpp.
|
protected |
Definition at line 97 of file validator-regex.hpp.
| ndn::ValidatorRegex::ValidatorRegex | ( | Face & | face, |
| shared_ptr< CertificateCache > | certificateCache = DEFAULT_CERTIFICATE_CACHE, |
||
| const int | stepLimit = 3 |
||
| ) |
Definition at line 24 of file validator-regex.cpp.
| ndn::ValidatorRegex::ValidatorRegex | ( | const shared_ptr< Face > & | face, |
| shared_ptr< CertificateCache > | certificateCache = DEFAULT_CERTIFICATE_CACHE, |
||
| const int | stepLimit = 3 |
||
| ) |
Definition at line 35 of file validator-regex.cpp.
|
inlinevirtual |
Definition at line 46 of file validator-regex.hpp.
|
inline |
Add a rule for data verification.
| policy | The verification rule |
Definition at line 108 of file validator-regex.hpp.
|
inline |
Add a trust anchor.
| certificate | The trust anchor |
Definition at line 114 of file validator-regex.hpp.
|
protectedvirtual |
Check the Data against policy and return the next validation step if necessary.
If there is no next validation step, that validation MUST have been done. i.e., either onValidated or onValidationFailed callback is invoked.
| data | The Data to check. |
| nSteps | The number of validation steps that have been done. |
| onDataValidated | If the Data is validated, this calls onValidated(data). |
| onDataValidationFailed | If validation fails, this calls onValidationFailed(data). |
| nextSteps | On return, contains the next validation step. |
Implements ndn::Validator.
Definition at line 86 of file validator-regex.cpp.
|
inlineprotectedvirtual |
Check the Interest against validation policy and return the next validation step if necessary.
If there is no next validation step, that validation MUST have been done. i.e., either onValidated or onValidationFailed callback is invoked.
| data | The Interest to check. |
| nSteps | The number of validation steps that have been done. |
| OnInterestValidated | If the Interest is validated, this calls onValidated(data). |
| OnInterestValidationFailed | If validation fails, this calls onValidationFailed(data). |
Implements ndn::Validator.
Definition at line 75 of file validator-regex.hpp.
|
protected |
Definition at line 47 of file validator-regex.cpp.
|
protected |
Definition at line 77 of file validator-regex.cpp.
|
inlineinherited |
Validate Data and call either onValidated or onValidationFailed.
| data | The Data with the signature to check. |
| onValidated | If the Data is validated, this calls onValidated(data). |
| onValidationFailed | If validation fails, this calls onValidationFailed(data). |
Definition at line 53 of file validator.hpp.
|
inlineinherited |
Validate Interest and call either onValidated or onValidationFailed.
| interest | The Interest with the signature to check. |
| onValidated | If the Interest is validated, this calls onValidated(interest). |
| onValidationFailed | If validation fails, this calls onValidationFailed(interest). |
Definition at line 68 of file validator.hpp.
|
staticinherited |
Verify the data using the publicKey.
Definition at line 128 of file validator.cpp.
|
staticinherited |
Verify the signed Interest using the publicKey.
(Note the signature covers the first n-2 name components).
Definition at line 153 of file validator.cpp.
|
staticinherited |
Verify the blob using the publicKey against the signature.
Definition at line 195 of file validator.cpp.
|
inlinestaticinherited |
Verify the data using the publicKey against the SHA256-RSA signature.
Definition at line 97 of file validator.hpp.
|
inlinestaticinherited |
Verify the interest using the publicKey against the SHA256-RSA signature.
(Note the signature covers the first n-2 name components).
Definition at line 111 of file validator.hpp.
|
inlinestaticinherited |
Verify the blob using the publicKey against the SHA256-RSA signature.
Definition at line 127 of file validator.hpp.
|
staticinherited |
Verify the blob using the publicKey against the SHA256-RSA signature.
Definition at line 220 of file validator.cpp.
|
inlinestaticinherited |
Verify the data against the SHA256 signature.
Definition at line 144 of file validator.hpp.
|
inlinestaticinherited |
Verify the interest against the SHA256 signature.
(Note the signature covers the first n-2 name components).
Definition at line 157 of file validator.hpp.
|
inlinestaticinherited |
Verify the blob against the SHA256 signature.
Definition at line 171 of file validator.hpp.
|
staticinherited |
Verify the blob against the SHA256 signature.
Definition at line 247 of file validator.cpp.
|
static |
Definition at line 32 of file validator-regex.hpp.
|
protected |
Definition at line 101 of file validator-regex.hpp.
|
protectedinherited |
Definition at line 251 of file validator.hpp.
|
protectedinherited |
Definition at line 250 of file validator.hpp.
|
protected |
Definition at line 102 of file validator-regex.hpp.
|
protected |
Definition at line 100 of file validator-regex.hpp.
|
protected |
Definition at line 104 of file validator-regex.hpp.
|
protected |
Definition at line 103 of file validator-regex.hpp.