23 #ifndef NDN_SIGNING_INFO_HPP
24 #define NDN_SIGNING_INFO_HPP
26 #include "../name.hpp"
27 #include "../signature.hpp"
28 #include "pib/pib-identity.hpp"
29 #include "pib/pib-key.hpp"
30 #include "security-common.hpp"
68 digestAlgorithm_ = DIGEST_ALGORITHM_SHA256;
80 digestAlgorithm_ = DIGEST_ALGORITHM_SHA256;
93 digestAlgorithm_ = DIGEST_ALGORITHM_SHA256;
126 name_ = identityName;
154 name_ = certificateName;
167 digestAlgorithm_ = DIGEST_ALGORITHM_SHA256;
183 name_ = identity ? identity->getName() :
Name();
184 identity_ = identity;
200 name_ = key ? key->getName() :
Name();
227 const ptr_lib::shared_ptr<PibIdentity>&
237 const ptr_lib::shared_ptr<PibKey>&
248 digestAlgorithm_ = digestAlgorithm;
269 validityPeriod_ = validityPeriod;
308 ptr_lib::shared_ptr<PibIdentity> identity_;
309 ptr_lib::shared_ptr<PibKey> key_;
310 DigestAlgorithm digestAlgorithm_;
315 operator << (std::ostream& os,
const SigningInfo& info)
317 os << info.toString();
DigestAlgorithm getDigestAlgorithm() const
Get the digest algorithm for public key operations.
Definition: signing-info.hpp:257
const ptr_lib::shared_ptr< PibKey > & getPibKey() const
Get the PibKey of the signer.
Definition: signing-info.cpp:69
The signer is a key.
Definition: signing-info.hpp:47
std::string toString() const
Get the string representation of this SigningInfo.
Definition: signing-info.cpp:77
Use a SHA-256 digest.
Definition: signing-info.hpp:51
SigningInfo(const ptr_lib::shared_ptr< PibIdentity > &identity)
Create a SigningInfo of type SIGNER_TYPE_ID according to the given PibIdentity.
Definition: signing-info.hpp:78
SignerType
Definition: signing-info.hpp:41
A SigningInfo holds the signing parameters passed to the KeyChain.
Definition: signing-info.hpp:39
SigningInfo & setSigningKeyName(const Name &keyName)
Set this to type SIGNER_TYPE_KEY and a key with name keyName.
Definition: signing-info.hpp:137
SigningInfo & setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
Set the digest algorithm for public key operations.
Definition: signing-info.hpp:246
SigningInfo & setSigningCertificateName(const Name &certificateName)
Set this to type SIGNER_TYPE_CERT and a certificate with name certificateName.
Definition: signing-info.hpp:151
SigningInfo & setValidityPeriod(const ValidityPeriod &validityPeriod)
Set the validity period for the signature info.
Definition: signing-info.hpp:267
static Name getDigestSha256Identity()
Get the localhost identity which indicates that the signature is generated using SHA-256.
Definition: signing-info.hpp:295
A ValidityPeriod is used in a Data packet's SignatureInfo and represents the begin and end times of a...
Definition: validity-period.hpp:37
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
SigningInfo & setPibIdentity(const ptr_lib::shared_ptr< PibIdentity > &identity)
Set this to type SIGNER_TYPE_ID according to the given PibIdentity.
Definition: signing-info.hpp:180
SigningInfo & setPibKey(const ptr_lib::shared_ptr< PibKey > &key)
Set this to type SIGNER_TYPE_KEY according to the given PibKey.
Definition: signing-info.hpp:197
SignerType getSignerType() const
Get the type of the signer.
Definition: signing-info.hpp:210
const ValidityPeriod & getValidityPeriod() const
Get the validity period for the signature info.
Definition: signing-info.hpp:280
const ptr_lib::shared_ptr< PibIdentity > & getPibIdentity() const
Get the PibIdentity of the signer.
Definition: signing-info.cpp:61
No signer is specified.
Definition: signing-info.hpp:43
SigningInfo & setSha256Signing()
Set this to type SIGNER_TYPE_SHA256, and set the digest algorithm to DIGEST_ALGORITHM_SHA256.
Definition: signing-info.hpp:164
The signer is an identity.
Definition: signing-info.hpp:45
const Name & getSignerName() const
Get the name of signer.
Definition: signing-info.hpp:218
SigningInfo & setSigningIdentity(const Name &identityName)
Set this to type SIGNER_TYPE_ID and an identity with name identityName.
Definition: signing-info.hpp:123
SigningInfo(SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=Name())
Create a SigningInfo with the optional signerType and signerName and other default values...
Definition: signing-info.hpp:64
The signer is a certificate.
Definition: signing-info.hpp:49
SigningInfo(const ptr_lib::shared_ptr< PibKey > &key)
Create a SigningInfo of type SIGNER_TYPE_KEY according to the given PibKey.
Definition: signing-info.hpp:91