NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
signing-info.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #include "signing-info.hpp"
23 
24 namespace ndn {
25 namespace security {
26 
29 
31  const Name& signerName,
32  const SignatureInfo& signatureInfo)
33  : m_type(signerType)
34  , m_name(signerName)
35  , m_digestAlgorithm(DIGEST_ALGORITHM_SHA256)
36  , m_info(signatureInfo)
37 {
38 }
39 
40 void
42 {
43  m_type = SIGNER_TYPE_ID;
44  m_name = identity;
45 }
46 void
48 {
49  m_type = SIGNER_TYPE_KEY;
50  m_name = keyName;
51 }
52 
53 void
54 SigningInfo::setSigningCertName(const Name& certificateName)
55 {
56  m_type = SIGNER_TYPE_CERT;
57  m_name = certificateName;
58 }
59 
60 void
62 {
63  m_type = SIGNER_TYPE_SHA256;
64  m_name.clear();
65 }
66 
67 void
69 {
70  m_info = signatureInfo;
71 }
72 
73 } // namespace ndn
74 } // namespace security
SigningInfo(SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=EMPTY_NAME, const SignatureInfo &signatureInfo=EMPTY_SIGNATURE_INFO)
Constructor.
Copyright (c) 2011-2015 Regents of the University of California.
void setSigningCertName(const Name &certificateName)
Set signer as a certificate with name certificateName.
use sha256 digest, no signer needs to be specified
static const Name EMPTY_NAME
void setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
void setSha256Signing()
Set Sha256 as the signing method.
void setSignatureInfo(const SignatureInfo &signatureInfo)
Set a semi-prepared SignatureInfo;.
Name abstraction to represent an absolute name.
Definition: name.hpp:46
signer is a certificate, use it directly
signer is a key, use its default certificate
void setSigningKeyName(const Name &keyName)
Set signer as a key with name keyName.
signer is an identity, use its default key and default certificate
static const SignatureInfo EMPTY_SIGNATURE_INFO
void clear()
Clear all the components.
Definition: name.hpp:218