23 #ifndef NDN_FILE_PRIVATE_KEY_STORAGE_HPP
24 #define NDN_FILE_PRIVATE_KEY_STORAGE_HPP
27 #include "private-key-storage.hpp"
74 virtual ptr_lib::shared_ptr<PublicKey>
86 sign(
const uint8_t *data,
size_t dataLength,
const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256);
97 decrypt(
const Name& keyName,
const uint8_t* data,
size_t dataLength,
bool isSymmetric =
false);
108 encrypt(
const Name& keyName,
const uint8_t* data,
size_t dataLength,
bool isSymmetric =
false);
129 nameTransform(
const std::string& keyName,
const std::string& extension);
138 maintainMapping(
const std::string& keyName);
140 std::string keyStorePath_;
virtual Blob decrypt(const Name &keyName, const uint8_t *data, size_t dataLength, bool isSymmetric=false)
Decrypt data.
Definition: file-private-key-storage.cpp:167
FilePrivateKeyStorage extends PrivateKeyStorage to implement private key storage using files...
Definition: file-private-key-storage.hpp:37
FilePrivateKeyStorage(const std::string &keyStoreDirectoryPath="")
Create a new FilePrivateKeyStorage to connect to the given or default directory.
Definition: file-private-key-storage.cpp:42
virtual ~FilePrivateKeyStorage()
The virtual Destructor.
Definition: file-private-key-storage.cpp:71
virtual void generateKey(const Name &keyName, const KeyParams ¶ms)
Generate a symmetric key.
Definition: file-private-key-storage.cpp:182
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
virtual bool doesKeyExist(const Name &keyName, KeyClass keyClass)
Check if a particular key exists.
Definition: file-private-key-storage.cpp:188
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
virtual ptr_lib::shared_ptr< PublicKey > getPublicKey(const Name &keyName)
Get the public key.
Definition: file-private-key-storage.cpp:119
virtual void generateKeyPair(const Name &keyName, const KeyParams ¶ms)
Generate a pair of asymmetric keys.
Definition: file-private-key-storage.cpp:77
virtual Blob encrypt(const Name &keyName, const uint8_t *data, size_t dataLength, bool isSymmetric=false)
Encrypt data.
Definition: file-private-key-storage.cpp:175
KeyParams is a base class for key parameters.
Definition: key-params.hpp:36
virtual void deleteKeyPair(const Name &keyName)
Delete a pair of asymmetric keys.
Definition: file-private-key-storage.cpp:110
Definition: private-key-storage.hpp:39
virtual Blob sign(const uint8_t *data, size_t dataLength, const Name &keyName, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256)
Fetch the private key for keyName and sign the data, returning a signature Blob.
Definition: file-private-key-storage.cpp:140