NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
81
void
82
setSigningIdentity
(
const
Name
& identity);
83
88
void
89
setSigningKeyName
(
const
Name
& keyName);
90
95
void
96
setSigningCertName
(
const
Name
& certificateName);
97
102
void
103
setSha256Signing
();
104
108
SignerType
109
getSignerType
()
const
110
{
111
return
m_type;
112
}
113
117
const
Name
&
118
getSignerName
()
const
119
{
120
return
m_name;
121
}
122
126
void
127
setDigestAlgorithm
(
const
DigestAlgorithm
& algorithm)
128
{
129
m_digestAlgorithm = algorithm;
130
}
131
135
DigestAlgorithm
136
getDigestAlgorithm
()
const
137
{
138
return
m_digestAlgorithm;
139
}
140
144
void
145
setSignatureInfo
(
const
SignatureInfo
& signatureInfo);
146
150
const
SignatureInfo
&
151
getSignatureInfo
()
const
152
{
153
return
m_info;
154
}
155
156
public
:
157
static
const
Name
EMPTY_NAME
;
158
static
const
SignatureInfo
EMPTY_SIGNATURE_INFO
;
159
160
private
:
161
SignerType
m_type;
162
Name
m_name;
163
164
DigestAlgorithm
m_digestAlgorithm;
165
166
SignatureInfo
m_info;
167
};
168
169
}
// namespace security
170
}
// namespace ndn
171
172
#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:30
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::getSignerName
const Name & getSignerName() const
Definition:
signing-info.hpp:118
ndn::security::SigningInfo::setSigningCertName
void setSigningCertName(const Name &certificateName)
Set signer as a certificate with name certificateName.
Definition:
signing-info.cpp:54
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::SigningInfo::EMPTY_NAME
static const Name EMPTY_NAME
Definition:
signing-info.hpp:157
ndn::security::SigningInfo::setSigningIdentity
void setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
Definition:
signing-info.cpp:41
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:61
ndn::security::SigningInfo::setSignatureInfo
void setSignatureInfo(const SignatureInfo &signatureInfo)
Set a semi-prepared SignatureInfo;.
Definition:
signing-info.cpp:68
ndn::security::SigningInfo::getSignatureInfo
const SignatureInfo & getSignatureInfo() const
Definition:
signing-info.hpp:151
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:127
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:47
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::getDigestAlgorithm
DigestAlgorithm getDigestAlgorithm() const
Definition:
signing-info.hpp:136
ndn::security::SigningInfo::EMPTY_SIGNATURE_INFO
static const SignatureInfo EMPTY_SIGNATURE_INFO
Definition:
signing-info.hpp:158
ndn::security::SigningInfo::Error
Definition:
signing-info.hpp:39
ndn::DigestAlgorithm
DigestAlgorithm
Definition:
security-common.hpp:57
ndn::security::SigningInfo::getSignerType
SignerType getSignerType() const
Definition:
signing-info.hpp:109
security-common.hpp
ndnSIM
ndn-cxx
src
security
signing-info.hpp
Generated on Tue Feb 23 2016 22:18:43 for ndnSIM by
1.8.11