32 const Name& signerName,
37 , m_info(signatureInfo)
45 if (signingStr.empty()) {
49 size_t pos = signingStr.find(
':');
51 if (pos == std::string::npos) {
52 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Invalid signing string cannot represent SigningInfo"));
55 std::string scheme = signingStr.substr(0, pos);
56 std::string nameArg = signingStr.substr(pos + 1);
66 else if (scheme ==
"key") {
69 else if (scheme ==
"cert") {
73 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Invalid signing string scheme"));
94 m_name = certificateName;
107 m_info = signatureInfo;
129 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Unknown signer type"));
SigningInfo(SignerType signerType=SIGNER_TYPE_NULL, const Name &signerName=EMPTY_NAME, const SignatureInfo &signatureInfo=EMPTY_SIGNATURE_INFO)
Constructor.
Copyright (c) 2011-2015 Regents of the University of California.
void setSigningCertName(const Name &certificateName)
Set signer as a certificate with name certificateName.
use sha256 digest, no signer needs to be specified
Signing parameters passed to KeyChain.
std::ostream & operator<<(std::ostream &os, CommandInterestValidator::ErrorCode error)
const Name & getSignerName() const
static const Name EMPTY_NAME
void setSigningIdentity(const Name &identity)
Set signer as an identity with name identity.
no signer is specified, use default setting or follow the trust schema
void setSha256Signing()
Set Sha256 as the signing method.
void setSignatureInfo(const SignatureInfo &signatureInfo)
Set a semi-prepared SignatureInfo;.
Name abstraction to represent an absolute name.
signer is a certificate, use it directly
signer is a key, use its default certificate
void setSigningKeyName(const Name &keyName)
Set signer as a key with name keyName.
signer is an identity, use its default key and default certificate
static const Name DIGEST_SHA256_IDENTITY
A localhost identity which indicates that signature is generated using SHA-256.
static const SignatureInfo EMPTY_SIGNATURE_INFO
void clear()
Clear all the components.
SignerType getSignerType() const