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