ndn::security Namespace Reference

Namespaces

 detail
 
 pib
 
 tpm
 
 transform
 
 v2
 

Classes

class  InterestSigner
 Helper class to create signed Interests. More...
 
class  SafeBag
 a secured container for sensitive information(certificate, private key) More...
 
class  SigningInfo
 Signing parameters passed to KeyChain. More...
 
class  ValidatorConfig
 Helper for validator that uses SignedInterest + CommandInterest + Config policy and NetworkFetcher. More...
 
class  ValidityPeriod
 Abstraction of validity period. More...
 

Typedefs

using CommandInterestSigner = InterestSigner
 Helper class to create command Interests. More...
 

Enumerations

enum  SignedInterestFormat {
  SignedInterestFormat::V03,
  SignedInterestFormat::V02
}
 

Functions

std::ostream & operator<< (std::ostream &os, const ValidityPeriod &period)
 
std::ostream & operator<< (std::ostream &os, const SigningInfo &si)
 
std::ostream & operator<< (std::ostream &os, const SignedInterestFormat &format)
 
static ParseResult parse (const Data &data)
 
static ParseResult parse (const Interest &interest)
 
template size_t SafeBag ::wireEncode<::ndn::encoding::EncoderTag > (::ndn::EncodingBuffer &) const
 
template size_t SafeBag ::wireEncode<::ndn::encoding::EstimatorTag > (::ndn::EncodingEstimator &) const
 
SigningInfo signingByCertificate (const Name &certName)
 
SigningInfo signingByCertificate (const v2::Certificate &cert)
 
SigningInfo signingByIdentity (const Name &identityName)
 
SigningInfo signingByIdentity (const Identity &identity)
 
SigningInfo signingByKey (const Name &keyName)
 
SigningInfo signingByKey (const Key &key)
 
SigningInfo signingWithSha256 ()
 
template size_t ValidityPeriod ::wireEncode<::ndn::encoding::EncoderTag > (::ndn::EncodingBuffer &) const
 
template size_t ValidityPeriod ::wireEncode<::ndn::encoding::EstimatorTag > (::ndn::EncodingEstimator &) const
 
bool verifyDigest (const InputBuffers &blobs, const uint8_t *digest, size_t digestLen, DigestAlgorithm algorithm)
 Verify blobs against digest using algorithm. More...
 
bool verifyDigest (const uint8_t *blob, size_t blobLen, const uint8_t *digest, size_t digestLen, DigestAlgorithm algorithm)
 Verify blob against digest using algorithm. More...
 
bool verifyDigest (const Data &data, DigestAlgorithm algorithm)
 Verify data against digest algorithm. More...
 
bool verifyDigest (const Interest &interest, DigestAlgorithm algorithm)
 Verify interest against digest algorithm. More...
 
bool verifySignature (const InputBuffers &blobs, const uint8_t *sig, size_t sigLen, const transform::PublicKey &key)
 Verify blobs using key against sig. More...
 
bool verifySignature (const uint8_t *blob, size_t blobLen, const uint8_t *sig, size_t sigLen, const transform::PublicKey &key)
 Verify blob using key against sig. More...
 
bool verifySignature (const InputBuffers &blobs, const uint8_t *sig, size_t sigLen, const uint8_t *key, size_t keyLen)
 Verify blobs using key against sig. More...
 
bool verifySignature (const uint8_t *blob, size_t blobLen, const uint8_t *sig, size_t sigLen, const uint8_t *key, size_t keyLen)
 Verify blob using key against sig. More...
 
static bool verifySignature (ParseResult params, const transform::PublicKey &key)
 
static bool verifySignature (ParseResult params, const tpm::Tpm &tpm, const Name &keyName, DigestAlgorithm digestAlgorithm)
 
static bool verifySignature (ParseResult params, const uint8_t *key, size_t keyLen)
 
bool verifySignature (const Data &data, const transform::PublicKey &key)
 Verify data using key. More...
 
bool verifySignature (const Interest &interest, const transform::PublicKey &key)
 Verify interest using key. More...
 
bool verifySignature (const Data &data, const pib::Key &key)
 Verify data using key. More...
 
bool verifySignature (const Interest &interest, const pib::Key &key)
 Verify interest using key. More...
 
bool verifySignature (const Data &data, const uint8_t *key, size_t keyLen)
 Verify data using key. More...
 
bool verifySignature (const Interest &interest, const uint8_t *key, size_t keyLen)
 Verify interest using key. More...
 
bool verifySignature (const Data &data, const v2::Certificate &cert)
 Verify data using cert. More...
 
bool verifySignature (const Interest &interest, const v2::Certificate &cert)
 Verify interest using cert. More...
 
bool verifySignature (const Data &data, const tpm::Tpm &tpm, const Name &keyName, DigestAlgorithm digestAlgorithm)
 Verify data using tpm and keyName with the digestAlgorithm. More...
 
bool verifySignature (const Interest &interest, const tpm::Tpm &tpm, const Name &keyName, DigestAlgorithm digestAlgorithm)
 Verify interest using tpm and keyName with the digestAlgorithm. More...
 

Variables

static const size_t ISO_DATETIME_SIZE = 15
 
static const size_t NOT_AFTER_OFFSET = 1
 
static const size_t NOT_BEFORE_OFFSET = 0
 

Typedef Documentation

◆ CommandInterestSigner

Helper class to create command Interests.

Deprecated:
Command Interests have been deprecated in favor of signed Interests with timestamp, nonce, and/or sequence number components. Use InterestSigner instead.

Definition at line 35 of file command-interest-signer.hpp.

Enumeration Type Documentation

◆ SignedInterestFormat

Note
This is a transitional API to handle the change in signed Interest format and will disappear after a few releases.
Enumerator
V03 

Sign Interest using Packet Specification v0.3 semantics.

V02 

Sign Interest using Packet Specification v0.2 semantics.

Definition at line 39 of file signing-info.hpp.

Function Documentation

◆ operator<<() [1/3]

std::ostream & ndn::security::operator<< ( std::ostream &  os,
const ValidityPeriod period 
)

Definition at line 153 of file validity-period.cpp.

◆ operator<<() [2/3]

std::ostream & ndn::security::operator<< ( std::ostream &  os,
const SigningInfo si 
)

Definition at line 202 of file signing-info.cpp.

◆ operator<<() [3/3]

std::ostream & ndn::security::operator<< ( std::ostream &  os,
const SignedInterestFormat format 
)

Definition at line 223 of file signing-info.cpp.

◆ parse() [1/2]

static ParseResult ndn::security::parse ( const Data data)
static

Definition at line 110 of file verification-helpers.cpp.

◆ parse() [2/2]

static ParseResult ndn::security::parse ( const Interest interest)
static

Definition at line 123 of file verification-helpers.cpp.

◆ SafeBag ::wireEncode<::ndn::encoding::EncoderTag >()

template size_t ndn::security::SafeBag ::wireEncode<::ndn::encoding::EncoderTag > ( ::ndn::EncodingBuffer &  ) const

◆ SafeBag ::wireEncode<::ndn::encoding::EstimatorTag >()

template size_t ndn::security::SafeBag ::wireEncode<::ndn::encoding::EstimatorTag > ( ::ndn::EncodingEstimator &  ) const

◆ signingByCertificate() [1/2]

SigningInfo ndn::security::signingByCertificate ( const Name certName)
Returns
a SigningInfo for signing with a certificate

Definition at line 52 of file signing-helpers.cpp.

◆ signingByCertificate() [2/2]

SigningInfo ndn::security::signingByCertificate ( const v2::Certificate cert)
Returns
a SigningInfo for signing with a certificate

Definition at line 58 of file signing-helpers.cpp.

◆ signingByIdentity() [1/2]

SigningInfo ndn::security::signingByIdentity ( const Name identityName)
Returns
a SigningInfo for signing with an identity

Definition at line 28 of file signing-helpers.cpp.

◆ signingByIdentity() [2/2]

SigningInfo ndn::security::signingByIdentity ( const Identity identity)
Returns
a SigningInfo for signing with an identity

Definition at line 34 of file signing-helpers.cpp.

◆ signingByKey() [1/2]

SigningInfo ndn::security::signingByKey ( const Name keyName)
Returns
a SigningInfo for signing with a key

Definition at line 40 of file signing-helpers.cpp.

◆ signingByKey() [2/2]

SigningInfo ndn::security::signingByKey ( const Key key)
Returns
a SigningInfo for signing with a key

Definition at line 46 of file signing-helpers.cpp.

◆ signingWithSha256()

SigningInfo ndn::security::signingWithSha256 ( )
Returns
a SigningInfo for signing with Sha256

Definition at line 64 of file signing-helpers.cpp.

◆ ValidityPeriod ::wireEncode<::ndn::encoding::EncoderTag >()

template size_t ndn::security::ValidityPeriod ::wireEncode<::ndn::encoding::EncoderTag > ( ::ndn::EncodingBuffer &  ) const

◆ ValidityPeriod ::wireEncode<::ndn::encoding::EstimatorTag >()

template size_t ndn::security::ValidityPeriod ::wireEncode<::ndn::encoding::EstimatorTag > ( ::ndn::EncodingEstimator &  ) const

◆ verifyDigest() [1/4]

bool ndn::security::verifyDigest ( const InputBuffers &  bufs,
const uint8_t *  digest,
size_t  digestLen,
DigestAlgorithm  algorithm 
)

Verify blobs against digest using algorithm.

Definition at line 239 of file verification-helpers.cpp.

◆ verifyDigest() [2/4]

bool ndn::security::verifyDigest ( const uint8_t *  blob,
size_t  blobLen,
const uint8_t *  digest,
size_t  digestLen,
DigestAlgorithm  algorithm 
)

Verify blob against digest using algorithm.

Definition at line 262 of file verification-helpers.cpp.

◆ verifyDigest() [3/4]

bool ndn::security::verifyDigest ( const Data data,
DigestAlgorithm  algorithm 
)

Verify data against digest algorithm.

Definition at line 269 of file verification-helpers.cpp.

◆ verifyDigest() [4/4]

bool ndn::security::verifyDigest ( const Interest interest,
DigestAlgorithm  algorithm 
)

Verify interest against digest algorithm.

Note
This method verifies only signature of the signed interest.
See also
docs/specs/signed-interest.rst

Definition at line 277 of file verification-helpers.cpp.

◆ verifySignature() [1/17]

bool ndn::security::verifySignature ( const InputBuffers &  blobs,
const uint8_t *  sig,
size_t  sigLen,
const transform::PublicKey key 
)

Verify blobs using key against sig.

Definition at line 64 of file verification-helpers.cpp.

◆ verifySignature() [2/17]

bool ndn::security::verifySignature ( const uint8_t *  blob,
size_t  blobLen,
const uint8_t *  sig,
size_t  sigLen,
const transform::PublicKey key 
)

Verify blob using key against sig.

Definition at line 81 of file verification-helpers.cpp.

◆ verifySignature() [3/17]

bool ndn::security::verifySignature ( const InputBuffers &  blobs,
const uint8_t *  sig,
size_t  sigLen,
const uint8_t *  key,
size_t  keyLen 
)

Verify blobs using key against sig.

Note
key must be a public key in PKCS #8 format.

Definition at line 88 of file verification-helpers.cpp.

◆ verifySignature() [4/17]

bool ndn::security::verifySignature ( const uint8_t *  blob,
size_t  blobLen,
const uint8_t *  sig,
size_t  sigLen,
const uint8_t *  key,
size_t  keyLen 
)

Verify blob using key against sig.

Note
key must be a public key in PKCS #8 format.

Definition at line 103 of file verification-helpers.cpp.

◆ verifySignature() [5/17]

static bool ndn::security::verifySignature ( ParseResult  params,
const transform::PublicKey key 
)
static

Definition at line 156 of file verification-helpers.cpp.

◆ verifySignature() [6/17]

static bool ndn::security::verifySignature ( ParseResult  params,
const tpm::Tpm tpm,
const Name keyName,
DigestAlgorithm  digestAlgorithm 
)
static

Definition at line 162 of file verification-helpers.cpp.

◆ verifySignature() [7/17]

static bool ndn::security::verifySignature ( ParseResult  params,
const uint8_t *  key,
size_t  keyLen 
)
static

Definition at line 169 of file verification-helpers.cpp.

◆ verifySignature() [8/17]

bool ndn::security::verifySignature ( const Data data,
const transform::PublicKey key 
)

Verify data using key.

Definition at line 175 of file verification-helpers.cpp.

◆ verifySignature() [9/17]

bool ndn::security::verifySignature ( const Interest interest,
const transform::PublicKey key 
)

Verify interest using key.

Note
This method verifies only signature of the signed interest.
See also
docs/specs/signed-interest.rst

Definition at line 181 of file verification-helpers.cpp.

◆ verifySignature() [10/17]

bool ndn::security::verifySignature ( const Data data,
const pib::Key key 
)

Verify data using key.

Definition at line 187 of file verification-helpers.cpp.

◆ verifySignature() [11/17]

bool ndn::security::verifySignature ( const Interest interest,
const pib::Key key 
)

Verify interest using key.

Note
This method verifies only signature of the signed interest.
See also
docs/specs/signed-interest.rst

Definition at line 193 of file verification-helpers.cpp.

◆ verifySignature() [12/17]

bool ndn::security::verifySignature ( const Data data,
const uint8_t *  key,
size_t  keyLen 
)

Verify data using key.

Note
key must be a public key in PKCS #8 format.

Definition at line 199 of file verification-helpers.cpp.

◆ verifySignature() [13/17]

bool ndn::security::verifySignature ( const Interest interest,
const uint8_t *  key,
size_t  keyLen 
)

Verify interest using key.

Note
key must be a public key in PKCS #8 format.
This method verifies only signature of the signed interest.
See also
docs/specs/signed-interest.rst

Definition at line 205 of file verification-helpers.cpp.

◆ verifySignature() [14/17]

bool ndn::security::verifySignature ( const Data data,
const v2::Certificate cert 
)

Verify data using cert.

Definition at line 211 of file verification-helpers.cpp.

◆ verifySignature() [15/17]

bool ndn::security::verifySignature ( const Interest interest,
const v2::Certificate cert 
)

Verify interest using cert.

Note
This method verifies only signature of the signed interest.
See also
docs/specs/signed-interest.rst

Definition at line 217 of file verification-helpers.cpp.

◆ verifySignature() [16/17]

bool ndn::security::verifySignature ( const Data data,
const tpm::Tpm tpm,
const Name keyName,
DigestAlgorithm  digestAlgorithm 
)

Verify data using tpm and keyName with the digestAlgorithm.

Definition at line 223 of file verification-helpers.cpp.

◆ verifySignature() [17/17]

bool ndn::security::verifySignature ( const Interest interest,
const tpm::Tpm tpm,
const Name keyName,
DigestAlgorithm  digestAlgorithm 
)

Verify interest using tpm and keyName with the digestAlgorithm.

Note
This method verifies only signature of the signed interest.
See also
docs/specs/signed-interest.rst

Definition at line 230 of file verification-helpers.cpp.

Variable Documentation

◆ ISO_DATETIME_SIZE

const size_t ndn::security::ISO_DATETIME_SIZE = 15
static

Definition at line 36 of file validity-period.cpp.

◆ NOT_AFTER_OFFSET

const size_t ndn::security::NOT_AFTER_OFFSET = 1
static

Definition at line 38 of file validity-period.cpp.

◆ NOT_BEFORE_OFFSET

const size_t ndn::security::NOT_BEFORE_OFFSET = 0
static

Definition at line 37 of file validity-period.cpp.