#include <validator-config.hpp>
Classes | |
class | Error |
Public Member Functions | |
ValidatorConfig (Face *face=nullptr, const shared_ptr< CertificateCache > &certificateCache=DEFAULT_CERTIFICATE_CACHE, const time::milliseconds &graceInterval=DEFAULT_GRACE_INTERVAL, const size_t stepLimit=10, const size_t maxTrackedKeys=1000, const time::system_clock::Duration &keyTimestampTtl=DEFAULT_KEY_TIMESTAMP_TTL) | |
ValidatorConfig (Face &face, const shared_ptr< CertificateCache > &certificateCache=DEFAULT_CERTIFICATE_CACHE, const time::milliseconds &graceInterval=DEFAULT_GRACE_INTERVAL, const size_t stepLimit=10, const size_t maxTrackedKeys=1000, const time::system_clock::Duration &keyTimestampTtl=DEFAULT_KEY_TIMESTAMP_TTL) | |
virtual | ~ValidatorConfig () |
void | load (const std::string &filename) |
void | load (const std::string &input, const std::string &filename) |
void | load (std::istream &input, const std::string &filename) |
void | load (const security::conf::ConfigSection &configSection, const std::string &filename) |
void | reset () |
bool | isEmpty () |
Public Member Functions inherited from ndn::Validator | |
Validator (Face *face=nullptr) | |
Validator constructor. More... | |
Validator (Face &face) | |
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 |
static const time::milliseconds | DEFAULT_GRACE_INTERVAL |
static const time::system_clock::Duration | DEFAULT_KEY_TIMESTAMP_TTL = time::hours(1) |
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... | |
Protected Member Functions inherited from ndn::Validator | |
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 | 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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ndn::Validator | |
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 Signature &sig, const PublicKey &publicKey) |
Verify the data using the publicKey against the SHA256-RSA signature. More... | |
static bool | verifySignature (const Interest &interest, const Signature &sig, const 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 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... | |
Protected Types inherited from ndn::Validator | |
typedef function< void(const std::string &)> | OnFailure |
Protected Attributes inherited from ndn::Validator | |
Face * | m_face |
Definition at line 34 of file validator-config.hpp.
|
explicit |
Definition at line 38 of file validator-config.cpp.
References ndn::Face::getIoService().
Referenced by ndn::ValidatorConfig::Error::Error().
|
explicit |
Definition at line 57 of file validator-config.cpp.
References ndn::Face::getIoService().
|
inlinevirtual |
Definition at line 69 of file validator-config.hpp.
References checkPolicy(), isEmpty(), load(), and reset().
void ndn::ValidatorConfig::load | ( | const std::string & | filename | ) |
Definition at line 77 of file validator-config.cpp.
Referenced by load(), nfd::rib::RibManager::setConfigFile(), and ~ValidatorConfig().
void ndn::ValidatorConfig::load | ( | const std::string & | input, |
const std::string & | filename | ||
) |
Definition at line 92 of file validator-config.cpp.
References load().
void ndn::ValidatorConfig::load | ( | std::istream & | input, |
const std::string & | filename | ||
) |
Definition at line 100 of file validator-config.cpp.
References load().
void ndn::ValidatorConfig::load | ( | const security::conf::ConfigSection & | configSection, |
const std::string & | filename | ||
) |
Definition at line 120 of file validator-config.cpp.
References ndn::security::file, ndn::time::system_clock::now(), and reset().
void ndn::ValidatorConfig::reset | ( | ) |
Definition at line 378 of file validator-config.cpp.
Referenced by load(), and ~ValidatorConfig().
bool ndn::ValidatorConfig::isEmpty | ( | ) |
Definition at line 393 of file validator-config.cpp.
References ndn::time::system_clock::now().
Referenced by ~ValidatorConfig().
|
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. |
onValidated | If the Data is validated, this calls onValidated(data) |
onValidationFailed | If validation fails, this calls onValidationFailed(data) |
nextSteps | On return, contains the next validation step |
Implements ndn::Validator.
Definition at line 488 of file validator-config.cpp.
References ndn::Data::getSignature().
Referenced by ~ValidatorConfig().
|
protectedvirtual |
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.
interest | The Interest to check. |
nSteps | The number of validation steps that have been done. |
onValidated | If the Interest is validated, this calls onValidated(data) |
onValidationFailed | If validation fails, this calls onValidationFailed(data) |
nextSteps | On return, contains the next validation step |
Implements ndn::Validator.
Definition at line 523 of file validator-config.cpp.
References ndn::IdentityCertificate::certificateNameToPublicKeyName(), ndn::tlv::ContentType_Key, ndn::tlv::DigestSha256, ndn::time::fromUnixTimestamp(), ndn::Name::get(), ndn::Signature::getKeyLocator(), ndn::KeyLocator::getName(), ndn::Interest::getName(), ndn::KeyLocator::getType(), ndn::Signature::getType(), ndn::Signature::hasKeyLocator(), ndn::KeyLocator::KeyLocator_Name, ndn::signed_interest::MIN_LENGTH, ndn::time::system_clock::now(), ndn::signed_interest::POS_SIG_INFO, ndn::signed_interest::POS_SIG_VALUE, ndn::tlv::SignatureSha256WithEcdsa, ndn::tlv::SignatureSha256WithRsa, ndn::Name::size(), ndn::name::Component::toNumber(), ndn::Name::toUri(), and ndn::Validator::verifySignature().
|
static |
Definition at line 236 of file validator-config.hpp.
Referenced by ndn::ValidatorConfig::Error::Error().
|
static |
Definition at line 237 of file validator-config.hpp.
Referenced by ndn::ValidatorConfig::Error::Error().
|
static |
Definition at line 238 of file validator-config.hpp.
Referenced by ndn::ValidatorConfig::Error::Error().