22 #ifndef NDN_SECURITY_SEC_PUBLIC_INFO_HPP 23 #define NDN_SECURITY_SEC_PUBLIC_INFO_HPP 25 #include "../name.hpp" 42 class Error :
public std::runtime_error
47 :
std::runtime_error(what)
152 virtual shared_ptr<PublicKey>
191 virtual shared_ptr<IdentityCertificate>
436 shared_ptr<IdentityCertificate>
437 defaultCertificate());
444 shared_ptr<IdentityCertificate>
460 #endif // NDN_SECURITY_SEC_PUBLIC_INFO_HPP Name getDefaultCertificateNameForIdentity(const Name &identityName)
Get the default certificate name for the specified identity.
virtual void addIdentity(const Name &identityName)=0
Add a new identity.
virtual void getAllKeyNames(std::vector< Name > &nameList, bool isDefault)=0
Get all the key names from public info.
DEPRECATED(void addPublicKey(const Name &keyName, KeyType keyType, const PublicKey &publicKey))
Add a public key to the identity storage.
Copyright (c) 2011-2015 Regents of the University of California.
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.
virtual std::string getTpmLocator()=0
Get TPM Locator.
void setDefaultKeyNameForIdentity(const Name &keyName)
Set the default key name for the corresponding identity.
virtual void deleteCertificateInfo(const Name &certificateName)=0
Delete a certificate.
virtual void getAllCertificateNames(std::vector< Name > &nameList, bool isDefault)=0
Get all the certificate name in public info.
virtual void setDefaultIdentityInternal(const Name &identityName)=0
Set the default identity.
virtual bool doesIdentityExist(const Name &identityName)=0
Check if the specified identity already exists.
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 void getAllKeyNamesOfIdentity(const Name &identity, std::vector< Name > &nameList, bool isDefault)=0
Get all the key names of a particular 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.
virtual KeyType getPublicKeyType(const Name &keyName)=0
Get the type of the queried public key.
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.
virtual shared_ptr< PublicKey > getPublicKey(const Name &keyName)=0
Get shared pointer to PublicKey object from the identity storage.
virtual bool revokeIdentity()=0
Revoke the identity.
virtual void setTpmLocator(const std::string &tpmLocator)=0
Set the corresponding TPM information to tpmLocator.
Name abstraction to represent an absolute name.
virtual std::string getScheme()=0
return the scheme of the PibLocator
virtual void getAllIdentities(std::vector< Name > &nameList, bool isDefault)=0
Get all the identities from public info.
virtual bool doesCertificateExist(const Name &certificateName)=0
Check if the specified certificate already exists.
virtual ~SecPublicInfo()
The virtual Destructor.
SecPublicInfo(const std::string &location)
virtual void deletePublicKeyInfo(const Name &keyName)=0
Delete a public key and related certificates.
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.
virtual void getAllCertificateNamesOfKey(const Name &keyName, std::vector< Name > &nameList, bool isDefault)=0
Get all the certificate name of a particular key name.
virtual void deleteIdentityInfo(const Name &identity)=0
Delete an identity and related public keys and certificates.
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.
Error(const std::string &what)
SecPublicInfo is a base class for the storage of public information.
virtual void setDefaultCertificateNameForKeyInternal(const Name &certificateName)=0
Set the default certificate name for the corresponding key.