Signing parameters passed to KeyChain. More...
#include <ndn-cxx/security/signing-info.hpp>
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 , SIGNER_TYPE_HMAC = 5 } |
Public Member Functions | |
SigningInfo (const Identity &identity) | |
Construct from a PIB identity. More... | |
SigningInfo (const Key &key) | |
Construct from a PIB key. More... | |
SigningInfo (SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=Name(), const SignatureInfo &signatureInfo=SignatureInfo()) | |
Constructor. More... | |
SigningInfo (std::string_view signingStr) | |
Construct SigningInfo from its string representation. More... | |
DigestAlgorithm | getDigestAlgorithm () const |
Get the digest algorithm for signing operations. More... | |
shared_ptr< transform::PrivateKey > | getHmacKey () const |
const Identity & | getPibIdentity () const |
const Key & | getPibKey () const |
const SignatureInfo & | getSignatureInfo () const |
Get a semi-prepared SignatureInfo. More... | |
SignedInterestFormat | getSignedInterestFormat () const |
Get the signed Interest format. More... | |
const Name & | getSignerName () const |
SignerType | getSignerType () const |
Return the signer type. More... | |
SigningInfo & | setDigestAlgorithm (const DigestAlgorithm &algorithm) |
Set the digest algorithm for signing operations. More... | |
SigningInfo & | setPibIdentity (const Identity &identity) |
Set signer as a PIB identity handle identity . More... | |
SigningInfo & | setPibKey (const Key &key) |
Set signer as a PIB key handle key . More... | |
SigningInfo & | setSha256Signing () |
Set SHA-256 as the signing method. More... | |
SigningInfo & | setSignatureInfo (const SignatureInfo &signatureInfo) |
Set a semi-prepared SignatureInfo. More... | |
SigningInfo & | setSignedInterestFormat (SignedInterestFormat signedInterestFormat) |
Set the signed Interest format. More... | |
SigningInfo & | setSigningCertName (const Name &certificateName) |
Set signer as a certificate with name certificateName . More... | |
SigningInfo & | setSigningHmacKey (std::string_view hmacKey) |
Set signer to a base64-encoded HMAC key. More... | |
SigningInfo & | setSigningIdentity (const Name &identity) |
Set signer as an identity with name identity . More... | |
SigningInfo & | setSigningKeyName (const Name &keyName) |
Set signer as a key with name keyName . More... | |
Static Public Member Functions | |
static const Name & | getDigestSha256Identity () |
A localhost identity to indicate that the signature is generated using SHA-256. More... | |
static const Name & | getHmacIdentity () |
A localhost identity to indicate that the signature is generated using an HMAC key. More... | |
Friends | |
bool | operator!= (const SigningInfo &lhs, const SigningInfo &rhs) |
bool | operator== (const SigningInfo &lhs, const SigningInfo &rhs) |
Signing parameters passed to KeyChain.
A SigningInfo is invalid if the specified identity/key/certificate does not exist, or the PIB Identity or Key instance is not valid.
Definition at line 51 of file signing-info.hpp.
Definition at line 60 of file signing-info.hpp.
|
explicit |
Constructor.
signerType | The type of signer |
signerName | The name of the signer; interpretation differs with the type of signer |
signatureInfo | A semi-prepared SignatureInfo that contains all necessary information except SignatureType and KeyLocator. If SignatureType and/or KeyLocator is set, they will be overwritten by KeyChain::sign(). |
Definition at line 45 of file signing-info.cpp.
|
explicit |
Construct from a PIB identity.
Definition at line 57 of file signing-info.cpp.
|
explicit |
Construct from a PIB key.
Definition at line 63 of file signing-info.cpp.
|
explicit |
Construct SigningInfo from its string representation.
signingStr | The representative signing string for SigningInfo signing method |
Syntax of the representative string is as follows:
id:/<my-identity>
key:/<my-identity>/ksk-1
cert:/<my-identity>/KEY/ksk-1/ID-CERT/FD%01
hmac-sha256:<base64-encoded-key>
id:/localhost/identity/digest-sha256
Definition at line 69 of file signing-info.cpp.
|
inline |
Get the digest algorithm for signing operations.
Definition at line 229 of file signing-info.hpp.
|
static |
A localhost identity to indicate that the signature is generated using SHA-256.
Definition at line 32 of file signing-info.cpp.
|
static |
A localhost identity to indicate that the signature is generated using an HMAC key.
Definition at line 39 of file signing-info.cpp.
|
inline |
Definition at line 209 of file signing-info.hpp.
|
inline |
Definition at line 191 of file signing-info.hpp.
|
inline |
Definition at line 202 of file signing-info.hpp.
|
inline |
Get a semi-prepared SignatureInfo.
Definition at line 244 of file signing-info.hpp.
|
inline |
Get the signed Interest format.
Definition at line 267 of file signing-info.hpp.
|
inline |
Definition at line 180 of file signing-info.hpp.
|
inline |
Return the signer type.
Definition at line 171 of file signing-info.hpp.
|
inline |
Set the digest algorithm for signing operations.
Definition at line 219 of file signing-info.hpp.
SigningInfo & ndn::security::SigningInfo::setPibIdentity | ( | const Identity & | identity | ) |
Set signer as a PIB identity handle identity
.
Definition at line 161 of file signing-info.cpp.
SigningInfo & ndn::security::SigningInfo::setPibKey | ( | const Key & | key | ) |
Set signer as a PIB key handle key
.
Definition at line 170 of file signing-info.cpp.
SigningInfo & ndn::security::SigningInfo::setSha256Signing | ( | ) |
Set SHA-256 as the signing method.
Definition at line 153 of file signing-info.cpp.
SigningInfo & ndn::security::SigningInfo::setSignatureInfo | ( | const SignatureInfo & | signatureInfo | ) |
Set a semi-prepared SignatureInfo.
Definition at line 179 of file signing-info.cpp.
|
inline |
Set the signed Interest format.
Definition at line 255 of file signing-info.hpp.
SigningInfo & ndn::security::SigningInfo::setSigningCertName | ( | const Name & | certificateName | ) |
Set signer as a certificate with name certificateName
.
Definition at line 126 of file signing-info.cpp.
SigningInfo & ndn::security::SigningInfo::setSigningHmacKey | ( | std::string_view | hmacKey | ) |
Set signer to a base64-encoded HMAC key.
Definition at line 134 of file signing-info.cpp.
SigningInfo & ndn::security::SigningInfo::setSigningIdentity | ( | const Name & | identity | ) |
Set signer as an identity with name identity
.
Definition at line 108 of file signing-info.cpp.
SigningInfo & ndn::security::SigningInfo::setSigningKeyName | ( | const Name & | keyName | ) |
Set signer as a key with name keyName
.
Definition at line 117 of file signing-info.cpp.
|
friend |
Definition at line 296 of file signing-info.hpp.
|
friend |
Definition at line 290 of file signing-info.hpp.