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<v1::PublicKey>
191 virtual shared_ptr<v1::IdentityCertificate>
436 shared_ptr<v1::IdentityCertificate>
437 defaultCertificate());
444 shared_ptr<v1::IdentityCertificate>
464 #endif // NDN_SECURITY_SEC_PUBLIC_INFO_HPP SecPublicInfo(const std::string &location)
virtual bool revokeIdentity()=0
Revoke the identity.
Copyright (c) 2011-2015 Regents of the University of California.
virtual void addIdentity(const Name &identityName)=0
Add a new identity.
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.
Error(const std::string &what)
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.
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.
virtual void deleteCertificateInfo(const Name &certificateName)=0
Delete a certificate.
virtual void getAllCertificateNamesOfKey(const Name &keyName, std::vector< Name > &nameList, bool isDefault)=0
Get all the certificate name of a particular key name.
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 shared_ptr< v1::PublicKey > getPublicKey(const Name &keyName)=0
Get shared pointer to PublicKey object from the identity storage.
virtual void addKey(const Name &keyName, const v1::PublicKey &publicKey)=0
Add a public key to the identity storage.
virtual void getAllIdentities(std::vector< Name > &nameList, bool isDefault)=0
Get all the identities from public info.
virtual void setTpmLocator(const std::string &tpmLocator)=0
Set the corresponding TPM information to tpmLocator.
virtual bool doesIdentityExist(const Name &identityName)=0
Check if the specified identity already exists.
std::string getPibLocator()
Get PIB Locator.
virtual bool doesCertificateExist(const Name &certificateName)=0
Check if the specified certificate already exists.
shared_ptr< v1::IdentityCertificate > m_defaultCertificate
void setDefaultIdentity(const Name &identityName)
Set the default identity.
DEPRECATED(void addPublicKey(const Name &keyName, KeyType keyType, const v1::PublicKey &publicKey))
Add a public key to the identity storage.
virtual void getAllKeyNames(std::vector< Name > &nameList, bool isDefault)=0
Get all the key names from public info.
virtual void addCertificate(const v1::IdentityCertificate &certificate)=0
Add a certificate to the identity storage.
virtual void deleteIdentityInfo(const Name &identity)=0
Delete an identity and related public keys and certificates.
Name getDefaultCertificateName()
Get the default certificate name of the default identity.
virtual std::string getTpmLocator()=0
Get TPM Locator.
virtual KeyType getPublicKeyType(const Name &keyName)=0
Get the type of the queried public key.
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.
virtual void getAllKeyNamesOfIdentity(const Name &identity, std::vector< Name > &nameList, bool isDefault)=0
Get all the key names of a particular identity.
virtual Name getDefaultIdentity()=0
Get name of the default identity.
SecPublicInfo is a base class for the storage of public information.
void refreshDefaultCertificate()
try to get the default certificate of the default identity from the public info
virtual void getAllCertificateNames(std::vector< Name > &nameList, bool isDefault)=0
Get all the certificate name in public info.
virtual void setDefaultKeyNameForIdentityInternal(const Name &keyName)=0
Set the default key name for the corresponding identity.
virtual void deletePublicKeyInfo(const Name &keyName)=0
Delete a public key and related certificates.
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.