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

Signing parameters passed to KeyChain. More...

#include <signing-info.hpp>

Collaboration diagram for ndn::security::SigningInfo:

Classes

class  Error
 

Public Types

enum  SignerType {
  SIGNER_TYPE_NULL = 0, SIGNER_TYPE_ID = 1, SIGNER_TYPE_KEY = 2, SIGNER_TYPE_CERT = 3,
  SIGNER_TYPE_SHA256 = 4
}
 

Public Member Functions

 SigningInfo (SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=EMPTY_NAME, const SignatureInfo &signatureInfo=EMPTY_SIGNATURE_INFO)
 Constructor. More...
 
 SigningInfo (const std::string &signingStr)
 Construct SigningInfo from its string representation. More...
 
void setSigningIdentity (const Name &identity)
 Set signer as an identity with name identity. More...
 
void setSigningKeyName (const Name &keyName)
 Set signer as a key with name keyName. More...
 
void setSigningCertName (const Name &certificateName)
 Set signer as a certificate with name certificateName. More...
 
void setSha256Signing ()
 Set Sha256 as the signing method. More...
 
SignerType getSignerType () const
 
const NamegetSignerName () const
 
void setDigestAlgorithm (const DigestAlgorithm &algorithm)
 Set the digest algorithm for public key operations. More...
 
DigestAlgorithm getDigestAlgorithm () const
 
void setSignatureInfo (const SignatureInfo &signatureInfo)
 Set a semi-prepared SignatureInfo;. More...
 
const SignatureInfogetSignatureInfo () const
 

Static Public Attributes

static const Name EMPTY_NAME
 
static const SignatureInfo EMPTY_SIGNATURE_INFO
 

Detailed Description

Signing parameters passed to KeyChain.

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

Member Enumeration Documentation

◆ SignerType

Enumerator
SIGNER_TYPE_NULL 

no signer is specified, use default setting or follow the trust schema

SIGNER_TYPE_ID 

signer is an identity, use its default key and default certificate

SIGNER_TYPE_KEY 

signer is a key, use its default certificate

SIGNER_TYPE_CERT 

signer is a certificate, use it directly

SIGNER_TYPE_SHA256 

use sha256 digest, no signer needs to be specified

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

Constructor & Destructor Documentation

◆ SigningInfo() [1/2]

ndn::security::SigningInfo::SigningInfo ( SignerType  signerType = SIGNER_TYPE_NULL,
const Name signerName = EMPTY_NAME,
const SignatureInfo signatureInfo = EMPTY_SIGNATURE_INFO 
)
explicit

Constructor.

Parameters
signerTypeThe type of signer
signerNameThe name of signer; interpretation differs per signerType
signatureInfoA semi-prepared SignatureInfo which contains other information except SignatureType and KeyLocator. If SignatureType and KeyLocator are specified, they may be overwritten by KeyChain.

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

References ndn::SHA256.

Referenced by SigningInfo().

◆ SigningInfo() [2/2]

ndn::security::SigningInfo::SigningInfo ( const std::string &  signingStr)
explicit

Construct SigningInfo from its string representation.

Parameters
signingStrThe representative signing string for SigningInfo signing method

Structure of the representative string is as follows:

  • default signing: "" (empty string)
  • signing with a default certificate of a default key for the identity: id:/my-identity
  • signing with a default certificate of the key: key:/my-identity/ksk-1
  • signing with the certificate: cert:/my-identity/KEY/ksk-1/ID-CERT/FD%01
  • signing with sha256 digest: id:/localhost/identity/digest-sha256

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

References ndn::security::KeyChain::DIGEST_SHA256_IDENTITY, setSha256Signing(), setSigningCertName(), setSigningIdentity(), setSigningKeyName(), and SigningInfo().

Member Function Documentation

◆ setSigningIdentity()

void ndn::security::SigningInfo::setSigningIdentity ( const Name identity)

Set signer as an identity with name identity.

Postcondition
Change the signerType to SIGNER_TYPE_ID

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

References SIGNER_TYPE_ID.

Referenced by SigningInfo().

◆ setSigningKeyName()

void ndn::security::SigningInfo::setSigningKeyName ( const Name keyName)

Set signer as a key with name keyName.

Postcondition
Change the signerType to SIGNER_TYPE_KEY

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

References SIGNER_TYPE_KEY.

Referenced by SigningInfo().

◆ setSigningCertName()

void ndn::security::SigningInfo::setSigningCertName ( const Name certificateName)

Set signer as a certificate with name certificateName.

Postcondition
Change the signerType to SIGNER_TYPE_CERT

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

References SIGNER_TYPE_CERT.

Referenced by SigningInfo().

◆ setSha256Signing()

void ndn::security::SigningInfo::setSha256Signing ( )

Set Sha256 as the signing method.

Postcondition
Reset signerName, also change the signerType to SIGNER_TYPE_SHA256

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

References ndn::Name::clear(), and SIGNER_TYPE_SHA256.

Referenced by SigningInfo().

◆ getSignerType()

SignerType ndn::security::SigningInfo::getSignerType ( ) const
inline

◆ getSignerName()

const Name& ndn::security::SigningInfo::getSignerName ( ) const
inline

◆ setDigestAlgorithm()

void ndn::security::SigningInfo::setDigestAlgorithm ( const DigestAlgorithm algorithm)
inline

Set the digest algorithm for public key operations.

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

◆ getDigestAlgorithm()

DigestAlgorithm ndn::security::SigningInfo::getDigestAlgorithm ( ) const
inline
Returns
The digest algorithm for public key operations

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

References setSignatureInfo().

Referenced by ndn::security::KeyChain::prepareUnsignedIdentityCertificate().

◆ setSignatureInfo()

void ndn::security::SigningInfo::setSignatureInfo ( const SignatureInfo signatureInfo)

Set a semi-prepared SignatureInfo;.

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

Referenced by getDigestAlgorithm().

◆ getSignatureInfo()

const SignatureInfo& ndn::security::SigningInfo::getSignatureInfo ( ) const
inline
Returns
Semi-prepared SignatureInfo

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

Referenced by ndn::security::KeyChain::prepareUnsignedIdentityCertificate().

Member Data Documentation

◆ EMPTY_NAME

const Name ndn::security::SigningInfo::EMPTY_NAME
static

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

◆ EMPTY_SIGNATURE_INFO

const SignatureInfo ndn::security::SigningInfo::EMPTY_SIGNATURE_INFO
static

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


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