23 #ifndef NDN_IDENTITY_STORAGE_HPP
24 #define NDN_IDENTITY_STORAGE_HPP
26 #include "../../name.hpp"
27 #include "../security-common.hpp"
31 class IdentityCertificate;
97 addKey(
const Name& keyName, KeyType keyType,
const Blob& publicKeyDer) = 0;
145 virtual ptr_lib::shared_ptr<IdentityCertificate>
208 (
const Name& identityName, std::vector<Name>& nameList,
bool isDefault) = 0;
219 (
const Name& keyName, std::vector<Name>& nameList,
bool isDefault) = 0;
252 virtual ptr_lib::shared_ptr<IdentityCertificate>
281 static bool lastTimestampIsInitialized_;
282 static uint64_t lastTimestamp_;
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
virtual bool doesIdentityExist(const Name &identityName)=0
Check if the specified identity already exists.
virtual void setDefaultIdentity(const Name &identityName)=0
Set the default identity.
virtual void addIdentity(const Name &identityName)=0
Add a new identity.
Definition: identity-certificate.hpp:30
virtual ptr_lib::shared_ptr< IdentityCertificate > getDefaultCertificate()
Get the certificate of the default identity.
Definition: identity-storage.cpp:76
virtual ptr_lib::shared_ptr< IdentityCertificate > getCertificate(const Name &certificateName)=0
Get a certificate from the identity storage.
virtual void getAllCertificateNamesOfKey(const Name &keyName, std::vector< Name > &nameList, bool isDefault)=0
Append all the certificate names of a particular key name to the nameList.
Name getDefaultCertificateNameForIdentity(const Name &identityName)
Get the default certificate name for the specified identity.
Definition: identity-storage.cpp:69
virtual Name getDefaultCertificateNameForKey(const Name &keyName)=0
Get the default certificate name for the specified key.
Name getNewKeyName(const Name &identityName, bool useKsk)
Generate a name for a new key belonging to the identity.
Definition: identity-storage.cpp:41
virtual void deletePublicKeyInfo(const Name &keyName)=0
Delete a public key and related certificates.
virtual void setDefaultCertificateNameForKey(const Name &keyName, const Name &certificateName)=0
Set the default key name for the specified identity.
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
virtual void deleteCertificateInfo(const Name &certificateName)=0
Delete a certificate.
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 bool doesKeyExist(const Name &keyName)=0
Check if the specified key already exists.
virtual void addKey(const Name &keyName, KeyType keyType, const Blob &publicKeyDer)=0
Add a public key to the identity storage.
virtual void addCertificate(const IdentityCertificate &certificate)=0
Add a certificate to the identity storage.
virtual void setDefaultKeyNameForIdentity(const Name &keyName, const Name &identityNameCheck=Name())=0
Set a key as the default key of an identity.
virtual void activateKey(const Name &keyName)=0
Activate a key.
virtual Name getDefaultIdentity()=0
Get the default identity.
virtual void deleteIdentityInfo(const Name &identity)=0
Delete an identity and related public keys and certificates.
virtual ~IdentityStorage()
The virtual Destructor.
Definition: identity-storage.hpp:47
virtual bool doesCertificateExist(const Name &certificateName)=0
Check if the specified certificate already exists.
virtual Name getDefaultKeyNameForIdentity(const Name &identityName)=0
Get the default key name for the specified identity.
virtual bool revokeIdentity()=0
Revoke the identity.
virtual void getAllKeyNamesOfIdentity(const Name &identityName, std::vector< Name > &nameList, bool isDefault)=0
Append all the key names of a particular identity to the nameList.
virtual void getAllIdentities(std::vector< Name > &nameList, bool isDefault)=0
Append all the identity names to the nameList.
virtual void deactivateKey(const Name &keyName)=0
Deactivate a key.
virtual Blob getKey(const Name &keyName)=0
Get the public key DER blob from the identity storage.