All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ndn::ValidatorConfig Class Reference

#include <validator-config.hpp>

Inheritance diagram for ndn::ValidatorConfig:
[legend]
Collaboration diagram for ndn::ValidatorConfig:
[legend]

Data Structures

class  Error
 

Public Member Functions

 ValidatorConfig (Face &face, const shared_ptr< CertificateCache > &certificateCache=DEFAULT_CERTIFICATE_CACHE, const int stepLimit=10)
 
 ValidatorConfig (const shared_ptr< Face > &face, const shared_ptr< CertificateCache > &certificateCache=DEFAULT_CERTIFICATE_CACHE, const int stepLimit=10)
 
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 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 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 Attributes

bool m_hasFace
 
Facem_face
 

Detailed Description

Definition at line 17 of file validator-config.hpp.

Constructor & Destructor Documentation

ndn::ValidatorConfig::ValidatorConfig ( Face face,
const shared_ptr< CertificateCache > &  certificateCache = DEFAULT_CERTIFICATE_CACHE,
const int  stepLimit = 10 
)
explicit

Definition at line 19 of file validator-config.cpp.

ndn::ValidatorConfig::ValidatorConfig ( const shared_ptr< Face > &  face,
const shared_ptr< CertificateCache > &  certificateCache = DEFAULT_CERTIFICATE_CACHE,
const int  stepLimit = 10 
)
Deprecated:
Use the other version of the constructor

Definition at line 30 of file validator-config.cpp.

virtual ndn::ValidatorConfig::~ValidatorConfig ( )
inlinevirtual

Definition at line 45 of file validator-config.hpp.

Member Function Documentation

void ndn::ValidatorConfig::checkPolicy ( const Data data,
int  nSteps,
const OnDataValidated onValidated,
const OnDataValidationFailed onValidationFailed,
std::vector< shared_ptr< ValidationRequest > > &  nextSteps 
)
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.

Parameters
dataThe Data to check.
nStepsThe number of validation steps that have been done.
onDataValidatedIf the Data is validated, this calls onValidated(data).
onDataValidationFailedIf validation fails, this calls onValidationFailed(data).
nextStepsOn return, contains the next validation step.

Implements ndn::Validator.

Definition at line 285 of file validator-config.cpp.

void ndn::ValidatorConfig::checkPolicy ( const Interest interest,
int  nSteps,
const OnInterestValidated onValidated,
const OnInterestValidationFailed onValidationFailed,
std::vector< shared_ptr< ValidationRequest > > &  nextSteps 
)
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.

Parameters
dataThe Interest to check.
nStepsThe number of validation steps that have been done.
OnInterestValidatedIf the Interest is validated, this calls onValidated(data).
OnInterestValidationFailedIf validation fails, this calls onValidationFailed(data).
Returns
the indication of next validation step, null if there is no further step.

Implements ndn::Validator.

Definition at line 321 of file validator-config.cpp.

void ndn::ValidatorConfig::load ( const std::string &  filename)

Definition at line 43 of file validator-config.cpp.

void ndn::ValidatorConfig::load ( const std::string &  input,
const std::string &  filename 
)

Definition at line 58 of file validator-config.cpp.

void ndn::ValidatorConfig::load ( std::istream &  input,
const std::string &  filename 
)

Definition at line 66 of file validator-config.cpp.

void ndn::ValidatorConfig::load ( const security::conf::ConfigSection configSection,
const std::string &  filename 
)

Definition at line 86 of file validator-config.cpp.

void ndn::Validator::validate ( const Data data,
const OnDataValidated onValidated,
const OnDataValidationFailed onValidationFailed 
)
inlineinherited

Validate Data and call either onValidated or onValidationFailed.

Parameters
dataThe Data with the signature to check.
onValidatedIf the Data is validated, this calls onValidated(data).
onValidationFailedIf validation fails, this calls onValidationFailed(data).

Definition at line 53 of file validator.hpp.

void ndn::Validator::validate ( const Interest interest,
const OnInterestValidated onValidated,
const OnInterestValidationFailed onValidationFailed 
)
inlineinherited

Validate Interest and call either onValidated or onValidationFailed.

Parameters
interestThe Interest with the signature to check.
onValidatedIf the Interest is validated, this calls onValidated(interest).
onValidationFailedIf validation fails, this calls onValidationFailed(interest).

Definition at line 68 of file validator.hpp.

bool ndn::Validator::verifySignature ( const Data data,
const PublicKey publicKey 
)
staticinherited

Verify the data using the publicKey.

Definition at line 128 of file validator.cpp.

bool ndn::Validator::verifySignature ( const Interest interest,
const PublicKey publicKey 
)
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.

bool ndn::Validator::verifySignature ( const Buffer blob,
const Signature sig,
const PublicKey publicKey 
)
staticinherited

Verify the blob using the publicKey against the signature.

Definition at line 195 of file validator.cpp.

static bool ndn::Validator::verifySignature ( const Data data,
const SignatureSha256WithRsa sig,
const PublicKey publicKey 
)
inlinestaticinherited

Verify the data using the publicKey against the SHA256-RSA signature.

Definition at line 97 of file validator.hpp.

static bool ndn::Validator::verifySignature ( const Interest interest,
const SignatureSha256WithRsa sig,
const PublicKey publicKey 
)
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.

static bool ndn::Validator::verifySignature ( const Buffer blob,
const SignatureSha256WithRsa sig,
const PublicKey publicKey 
)
inlinestaticinherited

Verify the blob using the publicKey against the SHA256-RSA signature.

Definition at line 127 of file validator.hpp.

bool ndn::Validator::verifySignature ( const uint8_t *  buf,
const size_t  size,
const SignatureSha256WithRsa sig,
const PublicKey publicKey 
)
staticinherited

Verify the blob using the publicKey against the SHA256-RSA signature.

Definition at line 220 of file validator.cpp.

static bool ndn::Validator::verifySignature ( const Data data,
const SignatureSha256 sig 
)
inlinestaticinherited

Verify the data against the SHA256 signature.

Definition at line 144 of file validator.hpp.

static bool ndn::Validator::verifySignature ( const Interest interest,
const SignatureSha256 sig 
)
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.

static bool ndn::Validator::verifySignature ( const Buffer blob,
const SignatureSha256 sig 
)
inlinestaticinherited

Verify the blob against the SHA256 signature.

Definition at line 171 of file validator.hpp.

bool ndn::Validator::verifySignature ( const uint8_t *  buf,
const size_t  size,
const SignatureSha256 sig 
)
staticinherited

Verify the blob against the SHA256 signature.

Definition at line 247 of file validator.cpp.

Field Documentation

const shared_ptr< CertificateCache > ndn::ValidatorConfig::DEFAULT_CERTIFICATE_CACHE
static

Definition at line 30 of file validator-config.hpp.

Face& ndn::Validator::m_face
protectedinherited

Definition at line 251 of file validator.hpp.

bool ndn::Validator::m_hasFace
protectedinherited

Definition at line 250 of file validator.hpp.