22 #ifndef NDN_CXX_SECURITY_SIGNING_INFO_HPP
23 #define NDN_CXX_SECURITY_SIGNING_INFO_HPP
55 class Error :
public std::runtime_error
58 using std::runtime_error::runtime_error;
209 shared_ptr<transform::PrivateKey>
222 m_digestAlgorithm = algorithm;
232 return m_digestAlgorithm;
258 m_signedInterestFormat = signedInterestFormat;
270 return m_signedInterestFormat;
293 return !(lhs != rhs);
299 return lhs.m_type != rhs.m_type ||
300 lhs.m_name != rhs.m_name ||
301 lhs.m_digestAlgorithm != rhs.m_digestAlgorithm ||
302 lhs.m_info != rhs.m_info ||
303 lhs.m_signedInterestFormat != rhs.m_signedInterestFormat;
311 shared_ptr<transform::PrivateKey> m_hmacKey;
318 operator<<(std::ostream& os,
const SigningInfo& si);
Represents an absolute name.
Represents a SignatureInfo or InterestSignatureInfo TLV element.
Signing parameters passed to KeyChain.
const Key & getPibKey() const
SigningInfo(SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=Name(), const SignatureInfo &signatureInfo=SignatureInfo())
Constructor.
friend bool operator!=(const SigningInfo &lhs, const SigningInfo &rhs)
SigningInfo & setPibIdentity(const Identity &identity)
Set signer as a PIB identity handle identity.
const Name & getSignerName() const
SigningInfo & setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
SigningInfo & setSignedInterestFormat(SignedInterestFormat signedInterestFormat)
Set the signed Interest format.
static const Name & getDigestSha256Identity()
A localhost identity to indicate that the signature is generated using SHA-256.
SigningInfo & setSha256Signing()
Set SHA-256 as the signing method.
SigningInfo & setSigningCertName(const Name &certificateName)
Set signer as a certificate with name certificateName.
SigningInfo & setSigningHmacKey(const std::string &hmacKey)
Set signer to a base64-encoded HMAC key.
static const Name & getHmacIdentity()
A localhost identity to indicate that the signature is generated using an HMAC key.
friend bool operator==(const SigningInfo &lhs, const SigningInfo &rhs)
SigningInfo & setSignatureInfo(const SignatureInfo &signatureInfo)
Set a semi-prepared SignatureInfo.
SignerType getSignerType() const
Return the signer type.
const SignatureInfo & getSignatureInfo() const
Get a semi-prepared SignatureInfo.
const Identity & getPibIdentity() const
@ SIGNER_TYPE_CERT
Signer is a certificate, use it directly.
@ SIGNER_TYPE_SHA256
Use a SHA-256 digest only, no signer needs to be specified.
@ SIGNER_TYPE_HMAC
Signer is a HMAC key.
@ SIGNER_TYPE_NULL
No signer is specified, use default setting or follow the trust schema.
@ SIGNER_TYPE_ID
Signer is an identity, use its default key and default certificate.
@ SIGNER_TYPE_KEY
Signer is a key, use its default certificate.
shared_ptr< transform::PrivateKey > getHmacKey() const
SignedInterestFormat getSignedInterestFormat() const
Get the signed Interest format.
SigningInfo & setDigestAlgorithm(const DigestAlgorithm &algorithm)
Set the digest algorithm for signing operations.
DigestAlgorithm getDigestAlgorithm() const
Get the digest algorithm for signing operations.
SigningInfo & setSigningKeyName(const Name &keyName)
Set signer as a key with name keyName.
SigningInfo & setPibKey(const Key &key)
Set signer as a PIB key handle key.
Frontend handle for an identity in the PIB.
Frontend handle for a key in the PIB.
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
@ V03
Sign Interest using Packet Specification v0.3 semantics.
@ V02
Sign Interest using Packet Specification v0.2 semantics.