23 #ifndef NDN_FILE_PRIVATE_KEY_STORAGE_HPP
24 #define NDN_FILE_PRIVATE_KEY_STORAGE_HPP
27 #include "private-key-storage.hpp"
70 virtual ptr_lib::shared_ptr<PublicKey>
82 sign(
const uint8_t *data,
size_t dataLength,
const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256);
93 decrypt(
const Name& keyName,
const uint8_t* data,
size_t dataLength,
bool isSymmetric =
false);
104 encrypt(
const Name& keyName,
const uint8_t* data,
size_t dataLength,
bool isSymmetric =
false);
125 nameTransform(
const std::string& keyName,
const std::string& extension);
127 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:299
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
FilePrivateKeyStorage extends PrivateKeyStorage to implement private key storage using files...
Definition: file-private-key-storage.hpp:37
virtual ~FilePrivateKeyStorage()
The virtual Destructor.
Definition: file-private-key-storage.cpp:63
virtual void generateKey(const Name &keyName, const KeyParams ¶ms)
Generate a symmetric key.
Definition: file-private-key-storage.cpp:314
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:320
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
virtual ptr_lib::shared_ptr< PublicKey > getPublicKey(const Name &keyName)
Get the public key.
Definition: file-private-key-storage.cpp:199
virtual void generateKeyPair(const Name &keyName, const KeyParams ¶ms)
Generate a pair of asymmetric keys.
Definition: file-private-key-storage.cpp:69
virtual Blob encrypt(const Name &keyName, const uint8_t *data, size_t dataLength, bool isSymmetric=false)
Encrypt data.
Definition: file-private-key-storage.cpp:307
KeyParams is a base class for key parameters.
Definition: key-params.hpp:34
FilePrivateKeyStorage()
Create a new FilePrivateKeyStorage to connect to the default directory.
Definition: file-private-key-storage.cpp:44
virtual void deleteKeyPair(const Name &keyName)
Delete a pair of asymmetric keys.
Definition: file-private-key-storage.cpp:190
Definition: private-key-storage.hpp:40
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:220