NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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...
 
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

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

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 30 of file signing-info.cpp.

Member Function Documentation

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 41 of file signing-info.cpp.

References SIGNER_TYPE_ID.

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 47 of file signing-info.cpp.

References SIGNER_TYPE_KEY.

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 54 of file signing-info.cpp.

References SIGNER_TYPE_CERT.

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 61 of file signing-info.cpp.

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

SignerType ndn::security::SigningInfo::getSignerType ( ) const
inline
const Name& ndn::security::SigningInfo::getSignerName ( ) const
inline
Returns
Name of signer; interpretation differs per signerType

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

Referenced by ndn::security::KeyChain::prepareUnsignedIdentityCertificate(), and ndn::nfd::CommandOptions::setSigningInfo().

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

Set the digest algorithm for public key operations.

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

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

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

References setSignatureInfo().

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

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

Set a semi-prepared SignatureInfo;.

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

Referenced by getDigestAlgorithm().

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

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

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

Member Data Documentation

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

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

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

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


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