|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
36 static Name emptyName;
44 return emptySignatureInfo;
50 static Name digestSha256Identity(
"/localhost/identity/digest-sha256");
51 return digestSha256Identity;
57 static Name hmacIdentity(
"/localhost/identity/hmac");
62 const Name& signerName,
67 , m_info(signatureInfo)
87 if (signingStr.empty()) {
91 size_t pos = signingStr.find(
':');
92 if (pos == std::string::npos) {
93 NDN_THROW(std::invalid_argument(
"Invalid signing string cannot represent SigningInfo"));
96 std::string scheme = signingStr.substr(0, pos);
97 std::string nameArg = signingStr.substr(pos + 1);
107 else if (scheme ==
"key") {
110 else if (scheme ==
"cert") {
113 else if (scheme ==
"hmac-sha256") {
118 NDN_THROW(std::invalid_argument(
"Invalid signing string scheme"));
144 m_name = certificateName;
157 m_hmacKey = make_shared<transform::PrivateKey>();
180 m_identity = identity;
196 m_info = signatureInfo;
217 NDN_THROW(std::invalid_argument(
"Unknown signer type"));
SigningInfo(SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=getEmptyName(), const SignatureInfo &signatureInfo=getEmptySignatureInfo())
Constructor.
SigningInfo & setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
Signing parameters passed to KeyChain.
static const Name & getHmacIdentity()
A localhost identity to indicate that the signature is generated using an HMAC key.
const Name & getName() const
Get the name of the identity.
SigningInfo & setSigningHmacKey(const std::string &hmacKey)
Set signer to a base64-encoded HMAC key.
SigningInfo & setDigestAlgorithm(const DigestAlgorithm &algorithm)
Set the digest algorithm for signing operations.
Represents an absolute name.
SigningInfo & setSha256Signing()
Set SHA-256 as the signing method.
static const Name & getEmptyName()
SigningInfo & setSigningCertName(const Name &certificateName)
Set signer as a certificate with name certificateName.
@ SIGNER_TYPE_ID
Signer is an identity, use its default key and default certificate.
SigningInfo & setPibIdentity(const Identity &identity)
Set signer as a PIB identity handler identity.
@ SHA256
Use the SHA256 hash of the public key as key id.
std::ostream & operator<<(std::ostream &os, const SigningInfo &si)
Name & append(const Component &component)
Append a component.
Represents a SignatureInfo TLV element.
@ HMAC
HMAC key, supports sign/verify operations.
@ SIGNER_TYPE_KEY
Signer is a key, use its default certificate.
SigningInfo & setSignatureInfo(const SignatureInfo &signatureInfo)
Set a semi-prepared SignatureInfo;.
SignerType getSignerType() const
implements an output stream that constructs ndn::Buffer
const Name & getSignerName() const
Represents a name component.
const Name & getName() const
Get key name.
A frontend handle of a key instance.
static const SignatureInfo & getEmptySignatureInfo()
@ SIGNER_TYPE_CERT
Signer is a certificate, use it directly.
SigningInfo & setPibKey(const Key &key)
Set signer as a PIB key handler key.
@ SIGNER_TYPE_HMAC
Signer is a HMAC key.
SigningInfo & setSigningKeyName(const Name &keyName)
Set signer as a key with name keyName.
void clear()
Remove all components.
A frontend handle of an Identity.
shared_ptr< Buffer > buf()
Flush written data to the stream and return shared pointer to the underlying buffer.
static const Name & getDigestSha256Identity()
A localhost identity to indicate that the signature is generated using SHA-256.
Copyright (c) 2011-2015 Regents of the University of California.
@ SIGNER_TYPE_NULL
No signer is specified, use default setting or follow the trust schema.
@ SIGNER_TYPE_SHA256
Use a SHA-256 digest only, no signer needs to be specified.