24 #ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS 25 #include "../../security/v1/identity-certificate.hpp" 26 #include "../../security/signing-helpers.hpp" 27 #endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS 36 : m_timeout(DEFAULT_TIMEOUT)
37 , m_prefix(DEFAULT_PREFIX)
44 if (timeout <= time::milliseconds::zero()) {
45 BOOST_THROW_EXCEPTION(std::out_of_range(
"Timeout must be positive"));
62 m_signingInfo = signingInfo;
66 #ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS 69 CommandOptions::getSigningParamsKind()
const 79 BOOST_THROW_EXCEPTION(std::out_of_range(
"SigningInfo::SignerType is not convertible to " 80 "CommandOptions::SigningParamsKind"));
85 CommandOptions::getSigningIdentity()
const 92 CommandOptions::getSigningCertificate()
const 99 CommandOptions::setSigningDefault()
106 CommandOptions::setSigningIdentity(
const Name& identityName)
113 makeSigningInfoFromIdentityCertificate(
const Name& certificateName)
117 if (certificateName.
size() < 4) {
118 BOOST_THROW_EXCEPTION(std::invalid_argument(
"Certificate is invalid"));
125 CommandOptions::setSigningCertificate(
const Name& certificateName)
127 m_signingInfo = makeSigningInfoFromIdentityCertificate(certificateName);
134 m_signingInfo = makeSigningInfoFromIdentityCertificate(certificate.
getName());
138 #endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
Copyright (c) 2011-2015 Regents of the University of California.
CommandOptions()
constructs CommandOptions
const Name & getName() const
Get name of the Data packet.
picks the default certificate of a specific identity Name
static const Name DEFAULT_PREFIX
gives the default command prefix: ndn:/localhost/nfd
Signing parameters passed to KeyChain.
SigningInfo signingByCertificate(const Name &certName)
CommandOptions & setTimeout(const time::milliseconds &timeout)
sets command timeout
const Name & getSignerName() const
picks a specific identity certificate
contains options for ControlCommand execution
Copyright (c) 2011-2015 Regents of the University of California.
no signer is specified, use default setting or follow the trust schema
SigningInfo signingByIdentity(const Name &identity)
Name abstraction to represent an absolute name.
signer is a certificate, use it directly
CommandOptions & setSigningInfo(const security::SigningInfo &signingInfo)
sets signing parameters
size_t size() const
Get the number of components.
picks the default signing identity and certificate
static const time::milliseconds DEFAULT_TIMEOUT
gives the default command timeout: 10000ms
SigningParamsKind
indicates the selection of signing parameters
signer is an identity, use its default key and default certificate
CommandOptions & setPrefix(const Name &prefix)
sets command prefix
SignerType getSignerType() const