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 handler identity.
const Name & getSignerName() const
SigningInfo & setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
SigningInfo & setSignedInterestFormat(SignedInterestFormat signedInterestFormat)
Set 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
const SignatureInfo & getSignatureInfo() const
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
SigningInfo & setDigestAlgorithm(const DigestAlgorithm &algorithm)
Set the digest algorithm for signing operations.
DigestAlgorithm getDigestAlgorithm() const
SigningInfo & setSigningKeyName(const Name &keyName)
Set signer as a key with name keyName.
SigningInfo & setPibKey(const Key &key)
Set signer as a PIB key handler key.
A frontend handle of an Identity.
A frontend handle of a key instance.
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.