8 #ifndef NDN_SECURITY_SEC_PUBLIC_INFO_MEMORY_HPP
9 #define NDN_SECURITY_SEC_PUBLIC_INFO_MEMORY_HPP
11 #include "../common.hpp"
51 virtual shared_ptr<PublicKey>
60 virtual shared_ptr<IdentityCertificate>
112 : m_keyType(keyType), m_key(key)
133 std::vector<std::string> m_identityStore;
134 std::string m_defaultIdentity;
135 Name m_defaultKeyName;
139 typedef std::map<std::string, shared_ptr<KeyRecord> > KeyStore;
142 typedef std::map<std::string, shared_ptr<IdentityCertificate> > CertificateStore;
145 CertificateStore m_certificateStore;
150 #endif //NDN_SECURITY_SEC_PUBLIC_INFO_MEMORY_HPP
virtual ~SecPublicInfoMemory()
virtual bool doesPublicKeyExist(const Name &keyName)
Check if the specified key already exists.
virtual bool doesIdentityExist(const Name &identityName)
Check if the specified identity already exists.
virtual void getAllIdentities(std::vector< Name > &nameList, bool isDefault)
Get all the identities in public info.
virtual bool doesCertificateExist(const Name &certificateName)
Check if the specified certificate already exists.
virtual void setDefaultCertificateNameForKeyInternal(const Name &certificateName)
Set the default certificate name for the corresponding key.
SecPublicInfoMemory extends SecPublicInfo and implements its methods to store identity, public key and certificate objects in memory.
virtual void getAllKeyNamesOfIdentity(const Name &identity, std::vector< Name > &nameList, bool isDefault)
Get all the key name of a particular identity.
virtual void deleteIdentityInfo(const Name &identity)
Delete an identity and related public keys and certificates.
virtual Name getDefaultKeyNameForIdentity(const Name &identityName)
Get the default key name for the specified identity.
virtual void setDefaultKeyNameForIdentityInternal(const Name &keyName)
Set the default key name for the corresponding identity.
virtual void getAllKeyNames(std::vector< Name > &nameList, bool isDefault)
Get all the key name in public info.
virtual shared_ptr< IdentityCertificate > getCertificate(const Name &certificateName)
Get a certificate from the identity storage.
virtual bool revokeIdentity()
Revoke the identity.
virtual void getAllCertificateNamesOfKey(const Name &keyName, std::vector< Name > &nameList, bool isDefault)
Get all the certificate name of a particular key.
Error(const std::string &what)
virtual void getAllCertificateNames(std::vector< Name > &nameList, bool isDefault)
Get all the certificate name in public info.
virtual void deletePublicKeyInfo(const Name &keyName)
Delete a public key and related certificates.
A Name holds an array of Name::Component and represents an NDN name.
virtual void setDefaultIdentityInternal(const Name &identityName)
Set the default identity.
virtual Name getDefaultIdentity()
Get the default identity.
virtual shared_ptr< PublicKey > getPublicKey(const Name &keyName)
Get the public key DER blob from the identity storage.
virtual void deleteCertificateInfo(const Name &certificateName)
Delete a certificate.
virtual void addPublicKey(const Name &keyName, KeyType keyType, const PublicKey &publicKeyDer)
Add a public key to the identity storage.
virtual Name getDefaultCertificateNameForKey(const Name &keyName)
Get the default certificate name for the specified key.
SecPublicInfo is a base class for the storage of public information.
virtual void addIdentity(const Name &identityName)
Add a new identity.
virtual void addCertificate(const IdentityCertificate &certificate)
Add a certificate to the identity storage.