NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
signing-info.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_SECURITY_SIGNING_INFO_HPP
23
#define NDN_SECURITY_SIGNING_INFO_HPP
24
25
#include "../name.hpp"
26
#include "../signature-info.hpp"
27
#include "
security-common.hpp
"
28
29
30
namespace
ndn
{
31
namespace
security
{
32
36
class
SigningInfo
37
{
38
public
:
39
class
Error
:
public
std::runtime_error
40
{
41
public
:
42
explicit
43
Error
(
const
std::string& what)
44
:
std
::runtime_error(what)
45
{
46
}
47
};
48
49
enum
SignerType
{
51
SIGNER_TYPE_NULL
= 0,
53
SIGNER_TYPE_ID
= 1,
55
SIGNER_TYPE_KEY
= 2,
57
SIGNER_TYPE_CERT
= 3,
59
SIGNER_TYPE_SHA256
= 4
60
};
61
62
public
:
72
explicit
73
SigningInfo
(
SignerType
signerType =
SIGNER_TYPE_NULL
,
74
const
Name
& signerName =
EMPTY_NAME
,
75
const
SignatureInfo
& signatureInfo =
EMPTY_SIGNATURE_INFO
);
76
89
explicit
90
SigningInfo
(
const
std::string& signingStr);
91
96
void
97
setSigningIdentity
(
const
Name
& identity);
98
103
void
104
setSigningKeyName
(
const
Name
& keyName);
105
110
void
111
setSigningCertName
(
const
Name
& certificateName);
112
117
void
118
setSha256Signing
();
119
123
SignerType
124
getSignerType
()
const
125
{
126
return
m_type;
127
}
128
132
const
Name
&
133
getSignerName
()
const
134
{
135
return
m_name;
136
}
137
141
void
142
setDigestAlgorithm
(
const
DigestAlgorithm
& algorithm)
143
{
144
m_digestAlgorithm = algorithm;
145
}
146
150
DigestAlgorithm
151
getDigestAlgorithm
()
const
152
{
153
return
m_digestAlgorithm;
154
}
155
159
void
160
setSignatureInfo
(
const
SignatureInfo
& signatureInfo);
161
165
const
SignatureInfo
&
166
getSignatureInfo
()
const
167
{
168
return
m_info;
169
}
170
171
public
:
172
static
const
Name
EMPTY_NAME
;
173
static
const
SignatureInfo
EMPTY_SIGNATURE_INFO
;
174
175
private
:
176
SignerType
m_type;
177
Name
m_name;
178
179
DigestAlgorithm
m_digestAlgorithm;
180
181
SignatureInfo
m_info;
182
};
183
184
std::ostream&
185
operator<<
(std::ostream& os,
const
SigningInfo
& si);
186
187
}
// namespace security
188
}
// namespace ndn
189
190
#endif // NDN_SECURITY_SIGNING_INFO_HPP
ndn::security::SigningInfo::SigningInfo
SigningInfo(SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=EMPTY_NAME, const SignatureInfo &signatureInfo=EMPTY_SIGNATURE_INFO)
Constructor.
Definition:
signing-info.cpp:31
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::SignatureInfo
Definition:
signature-info.hpp:32
ndn::security::SigningInfo::getSignatureInfo
const SignatureInfo & getSignatureInfo() const
Definition:
signing-info.hpp:166
ndn::security::SigningInfo::getDigestAlgorithm
DigestAlgorithm getDigestAlgorithm() const
Definition:
signing-info.hpp:151
ndn::security::SigningInfo::setSigningCertName
void setSigningCertName(const Name &certificateName)
Set signer as a certificate with name certificateName.
Definition:
signing-info.cpp:91
std
STL namespace.
ndn::security::SigningInfo::SIGNER_TYPE_SHA256
use sha256 digest, no signer needs to be specified
Definition:
signing-info.hpp:59
ndn::security::SigningInfo
Signing parameters passed to KeyChain.
Definition:
signing-info.hpp:36
ndn::security::operator<<
std::ostream & operator<<(std::ostream &os, CommandInterestValidator::ErrorCode error)
Definition:
command-interest-validator.cpp:30
ndn::security::SigningInfo::getSignerName
const Name & getSignerName() const
Definition:
signing-info.hpp:133
ndn::security::SigningInfo::EMPTY_NAME
static const Name EMPTY_NAME
Definition:
signing-info.hpp:172
ndn::security::SigningInfo::setSigningIdentity
void setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
Definition:
signing-info.cpp:78
ndn::security::SigningInfo::SIGNER_TYPE_NULL
no signer is specified, use default setting or follow the trust schema
Definition:
signing-info.hpp:51
ndn::security::SigningInfo::setSha256Signing
void setSha256Signing()
Set Sha256 as the signing method.
Definition:
signing-info.cpp:98
ndn::security::SigningInfo::setSignatureInfo
void setSignatureInfo(const SignatureInfo &signatureInfo)
Set a semi-prepared SignatureInfo;.
Definition:
signing-info.cpp:105
ndn::security::SigningInfo::Error::Error
Error(const std::string &what)
Definition:
signing-info.hpp:43
ndn::security::SigningInfo::setDigestAlgorithm
void setDigestAlgorithm(const DigestAlgorithm &algorithm)
Set the digest algorithm for public key operations.
Definition:
signing-info.hpp:142
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::security::SigningInfo::SIGNER_TYPE_CERT
signer is a certificate, use it directly
Definition:
signing-info.hpp:57
ndn::security::SigningInfo::SignerType
SignerType
Definition:
signing-info.hpp:49
ndn::security::SigningInfo::SIGNER_TYPE_KEY
signer is a key, use its default certificate
Definition:
signing-info.hpp:55
ndn::security::SigningInfo::setSigningKeyName
void setSigningKeyName(const Name &keyName)
Set signer as a key with name keyName.
Definition:
signing-info.cpp:84
ndn::security::SigningInfo::SIGNER_TYPE_ID
signer is an identity, use its default key and default certificate
Definition:
signing-info.hpp:53
ndn::security::SigningInfo::EMPTY_SIGNATURE_INFO
static const SignatureInfo EMPTY_SIGNATURE_INFO
Definition:
signing-info.hpp:173
ndn::security::SigningInfo::Error
Definition:
signing-info.hpp:39
ndn::DigestAlgorithm
DigestAlgorithm
Definition:
security-common.hpp:70
security
security-common.hpp
ndn::security::SigningInfo::getSignerType
SignerType getSignerType() const
Definition:
signing-info.hpp:124
ndnSIM
ndn-cxx
src
security
signing-info.hpp
Generated on Wed Jan 11 2017 18:17:14 for ndnSIM by
1.8.13