22 #ifndef NDN_MEMORY_IDENTITY_STORAGE_HPP
23 #define NDN_MEMORY_IDENTITY_STORAGE_HPP
27 #include "identity-storage.hpp"
82 addKey(
const Name& keyName, KeyType keyType,
const Blob& publicKeyDer);
128 virtual ptr_lib::shared_ptr<IdentityCertificate>
172 (
const Name& identityName, std::vector<Name>& nameList,
bool isDefault);
226 KeyRecord(KeyType keyType,
const Blob &keyDer)
227 : keyType_(keyType), keyDer_(keyDer)
231 const KeyType getKeyType()
const {
return keyType_; }
233 const Blob& getKeyDer() {
return keyDer_; }
240 std::vector<std::string> identityStore_;
241 std::string defaultIdentity_;
242 std::map<std::string, ptr_lib::shared_ptr<KeyRecord> > keyStore_;
243 std::map<std::string, Blob> certificateStore_;
virtual Name getDefaultCertificateNameForKey(const Name &keyName)
Get the default certificate name for the specified key.
Definition: memory-identity-storage.cpp:169
Copyright (C) 2013-2015 Regents of the University of California.
Definition: common.hpp:35
virtual void setDefaultIdentity(const Name &identityName)
Set the default identity.
Definition: memory-identity-storage.cpp:186
virtual void getAllKeyNamesOfIdentity(const Name &identityName, std::vector< Name > &nameList, bool isDefault)
Append all the key names of a particular identity to the nameList.
Definition: memory-identity-storage.cpp:178
Definition: identity-certificate.hpp:30
virtual void setDefaultCertificateNameForKey(const Name &keyName, const Name &certificateName)
Set the default key name for the specified identity.
Definition: memory-identity-storage.cpp:205
virtual void deactivateKey(const Name &keyName)
Deactivate a key.
Definition: memory-identity-storage.cpp:102
virtual void deleteCertificateInfo(const Name &certificateName)
Delete a certificate.
Definition: memory-identity-storage.cpp:213
virtual bool revokeIdentity()
Revoke the identity.
Definition: memory-identity-storage.cpp:56
virtual bool doesKeyExist(const Name &keyName)
Check if the specified key already exists.
Definition: memory-identity-storage.cpp:64
MemoryIdentityStorage extends IdentityStorage and implements its methods to store identity...
Definition: memory-identity-storage.hpp:36
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:42
IdentityStorage is a base class for the storage of identity, public keys and certificates.
Definition: identity-storage.hpp:39
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
virtual Name getDefaultIdentity()
Get the default identity.
Definition: memory-identity-storage.cpp:152
virtual bool doesCertificateExist(const Name &certificateName)
Check if the specified certificate already exists.
Definition: memory-identity-storage.cpp:110
virtual bool doesIdentityExist(const Name &identityName)
Check if the specified identity already exists.
Definition: memory-identity-storage.cpp:39
virtual Name getDefaultKeyNameForIdentity(const Name &identityName)
Get the default key name for the specified identity.
Definition: memory-identity-storage.cpp:161
virtual ptr_lib::shared_ptr< IdentityCertificate > getCertificate(const Name &certificateName, bool allowAny=false)
Get a certificate from the identity storage.
Definition: memory-identity-storage.cpp:139
virtual void addIdentity(const Name &identityName)
Add a new identity.
Definition: memory-identity-storage.cpp:46
virtual void setDefaultKeyNameForIdentity(const Name &keyName, const Name &identityNameCheck=Name())
Set the default key name for the specified identity.
Definition: memory-identity-storage.cpp:197
virtual ~MemoryIdentityStorage()
The virtual Destructor.
Definition: memory-identity-storage.cpp:34
virtual void deleteIdentityInfo(const Name &identity)
Delete an identity and related public keys and certificates.
Definition: memory-identity-storage.cpp:229
virtual void addKey(const Name &keyName, KeyType keyType, const Blob &publicKeyDer)
Add a public key to the identity storage.
Definition: memory-identity-storage.cpp:70
virtual void deletePublicKeyInfo(const Name &keyName)
Delete a public key and related certificates.
Definition: memory-identity-storage.cpp:221
virtual void addCertificate(const IdentityCertificate &certificate)
Add a certificate to the identity storage.
Definition: memory-identity-storage.cpp:116
virtual Blob getKey(const Name &keyName)
Get the public key DER blob from the identity storage.
Definition: memory-identity-storage.cpp:83
virtual void activateKey(const Name &keyName)
Activate a key.
Definition: memory-identity-storage.cpp:94