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