NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::security::ValidatorRegex Class Reference

#include <validator-regex.hpp>

Inheritance diagram for ndn::security::ValidatorRegex:
Collaboration diagram for ndn::security::ValidatorRegex:

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< CertificateCacheDEFAULT_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 DatapreCertificateValidation (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< CertificateCachem_certificateCache
 
RuleList m_mustFailVerify
 
RuleList m_verifyPolicies
 
std::map< Name, shared_ptr< v1::IdentityCertificate > > m_trustAnchors
 
- Protected Attributes inherited from ndn::security::Validator
Facem_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...
 

Detailed Description

Definition at line 36 of file validator-regex.hpp.

Member Typedef Documentation

◆ RuleList

typedef std::vector< shared_ptr<SecRuleRelative> > ndn::security::ValidatorRegex::RuleList
protected

Definition at line 119 of file validator-regex.hpp.

◆ RegexList

typedef std::vector< shared_ptr<Regex> > ndn::security::ValidatorRegex::RegexList
protected

Definition at line 120 of file validator-regex.hpp.

Constructor & Destructor Documentation

◆ ValidatorRegex() [1/2]

ndn::security::ValidatorRegex::ValidatorRegex ( Face face = nullptr,
shared_ptr< CertificateCache certificateCache = DEFAULT_CERTIFICATE_CACHE,
const int  stepLimit = 3 
)
explicit
Note
When both certificate cache and face are not supplied, no cache will be used. However, if only face is supplied, a default cache will be created and used.

Definition at line 35 of file validator-regex.cpp.

References ndn::Face::getIoService(), and m_certificateCache.

Referenced by ndn::security::ValidatorRegex::Error::Error().

◆ ValidatorRegex() [2/2]

ndn::security::ValidatorRegex::ValidatorRegex ( Face face,
shared_ptr< CertificateCache certificateCache = DEFAULT_CERTIFICATE_CACHE,
const int  stepLimit = 3 
)
explicit
Deprecated:
Use the constructor taking Face* as parameter.

Definition at line 46 of file validator-regex.cpp.

References ndn::Face::getIoService(), and m_certificateCache.

◆ ~ValidatorRegex()

virtual ndn::security::ValidatorRegex::~ValidatorRegex ( )
inlinevirtual

Definition at line 65 of file validator-regex.hpp.

References addDataVerificationRule(), addTrustAnchor(), and checkPolicy().

Member Function Documentation

◆ addDataVerificationRule()

void ndn::security::ValidatorRegex::addDataVerificationRule ( shared_ptr< SecRuleRelative rule)

Add a rule for data verification.

Parameters
ruleThe verification rule

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

References m_mustFailVerify, and m_verifyPolicies.

Referenced by ~ValidatorRegex().

◆ addTrustAnchor()

void ndn::security::ValidatorRegex::addTrustAnchor ( shared_ptr< v1::IdentityCertificate certificate)

Add a trust anchor.

Parameters
certificateThe trust anchor

Definition at line 64 of file validator-regex.cpp.

References m_trustAnchors.

Referenced by ~ValidatorRegex().

◆ checkPolicy() [1/2]

◆ checkPolicy() [2/2]

virtual void ndn::security::ValidatorRegex::checkPolicy ( const Interest interest,
int  nSteps,
const OnInterestValidated onValidated,
const OnInterestValidationFailed onValidationFailed,
std::vector< shared_ptr< ValidationRequest > > &  nextSteps 
)
inlineprotectedvirtual

◆ onCertificateValidated()

void ndn::security::ValidatorRegex::onCertificateValidated ( const shared_ptr< const Data > &  signCertificate,
const shared_ptr< const Data > &  data,
const OnDataValidated onValidated,
const OnDataValidationFailed onValidationFailed 
)
protected

Definition at line 70 of file validator-regex.cpp.

References m_certificateCache, and ndn::security::Validator::verifySignature().

Referenced by checkPolicy().

◆ onCertificateValidationFailed()

void ndn::security::ValidatorRegex::onCertificateValidationFailed ( const shared_ptr< const Data > &  signCertificate,
const std::string &  failureInfo,
const shared_ptr< const Data > &  data,
const OnDataValidationFailed onValidationFailed 
)
protected

Definition at line 98 of file validator-regex.cpp.

Referenced by checkPolicy().

Member Data Documentation

◆ DEFAULT_CERTIFICATE_CACHE

const shared_ptr< CertificateCache > ndn::security::ValidatorRegex::DEFAULT_CERTIFICATE_CACHE
static

Definition at line 116 of file validator-regex.hpp.

Referenced by ndn::security::ValidatorRegex::Error::Error().

◆ m_stepLimit

int ndn::security::ValidatorRegex::m_stepLimit
protected

Definition at line 122 of file validator-regex.hpp.

Referenced by checkPolicy().

◆ m_certificateCache

shared_ptr<CertificateCache> ndn::security::ValidatorRegex::m_certificateCache
protected

Definition at line 123 of file validator-regex.hpp.

Referenced by checkPolicy(), onCertificateValidated(), and ValidatorRegex().

◆ m_mustFailVerify

RuleList ndn::security::ValidatorRegex::m_mustFailVerify
protected

Definition at line 124 of file validator-regex.hpp.

Referenced by addDataVerificationRule(), and checkPolicy().

◆ m_verifyPolicies

RuleList ndn::security::ValidatorRegex::m_verifyPolicies
protected

Definition at line 125 of file validator-regex.hpp.

Referenced by addDataVerificationRule(), and checkPolicy().

◆ m_trustAnchors

std::map<Name, shared_ptr<v1::IdentityCertificate> > ndn::security::ValidatorRegex::m_trustAnchors
protected

Definition at line 126 of file validator-regex.hpp.

Referenced by addTrustAnchor(), and checkPolicy().


The documentation for this class was generated from the following files: