28 : m_location(location)
45 addKey(keyName, publicKey);
82 BOOST_THROW_EXCEPTION(
Error(
"No default certificate is set"));
90 std::ostringstream oss;
99 Name keyName =
Name(identityName).append(oss.str());
102 BOOST_THROW_EXCEPTION(
Error(
"Key name already exists: " + keyName.
toUri()));
138 shared_ptr<v1::IdentityCertificate>
139 SecPublicInfo::defaultCertificate()
144 shared_ptr<v1::IdentityCertificate>
SecPublicInfo(const std::string &location)
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix (PartialName) of the name, containing first nComponents components.
static Name certificateNameToPublicKeyName(const Name &certificateName)
Get the public key name from the full certificate name.
Copyright (c) 2011-2015 Regents of the University of California.
std::string toUri() const
Encode this name as a URI.
virtual Name getDefaultCertificateNameForKey(const Name &keyName)=0
Get name of the default certificate name for the specified key.
virtual shared_ptr< v1::IdentityCertificate > getCertificate(const Name &certificateName)=0
Get a shared pointer to identity certificate object from the identity storage.
void addCertificateAsSystemDefault(const v1::IdentityCertificate &certificate)
Add a certificate into the public key identity storage and set the certificate as the default one of ...
void addCertificateAsKeyDefault(const v1::IdentityCertificate &certificate)
Add a certificate and set the certificate as the default one of its corresponding key...
virtual void setDefaultIdentityInternal(const Name &identityName)=0
Set the default identity.
const Name & getName() const
Get name of the Data packet.
virtual std::string getScheme()=0
return the scheme of the PibLocator
virtual ~SecPublicInfo()
The virtual Destructor.
Name getNewKeyName(const Name &identityName, bool useKsk)
Generate a key name for the identity.
static time_point now() noexcept
void addCertificateAsIdentityDefault(const v1::IdentityCertificate &certificate)
Add a certificate into the public key identity storage and set the certificate as the default one of ...
shared_ptr< v1::IdentityCertificate > getDefaultCertificate()
Get cached default certificate of the default identity.
virtual void addKey(const Name &keyName, const v1::PublicKey &publicKey)=0
Add a public key to the identity storage.
std::string getPibLocator()
Get PIB Locator.
shared_ptr< v1::IdentityCertificate > m_defaultCertificate
void setDefaultIdentity(const Name &identityName)
Set the default identity.
virtual void addCertificate(const v1::IdentityCertificate &certificate)=0
Add a certificate to the identity storage.
Name getDefaultCertificateName()
Get the default certificate name of the default identity.
Name abstraction to represent an absolute name.
virtual bool doesPublicKeyExist(const Name &keyName)=0
Check if the specified key already exists.
Name getDefaultCertificateNameForIdentity(const Name &identityName)
Get the default certificate name for the specified identity.
milliseconds toUnixTimestamp(const system_clock::TimePoint &point)
Convert system_clock::TimePoint to UNIX timestamp.
virtual Name getDefaultIdentity()=0
Get name of the default identity.
void refreshDefaultCertificate()
try to get the default certificate of the default identity from the public info
virtual void setDefaultKeyNameForIdentityInternal(const Name &keyName)=0
Set the default key name for the corresponding identity.
virtual Name getDefaultKeyNameForIdentity(const Name &identityName)=0
Get name of the default key name for the specified identity.
virtual void setDefaultCertificateNameForKeyInternal(const Name &certificateName)=0
Set the default certificate name for the corresponding key.
void setDefaultCertificateNameForKey(const Name &certificateName)
Set the default certificate name for the corresponding key.
void setDefaultKeyNameForIdentity(const Name &keyName)
Set the default key name for the corresponding identity.