|
|
virtual | ~PrivateKeyStorage () |
| | The virtual destructor.
|
| |
| virtual void | generateKeyPair (const Name &keyName, const KeyParams ¶ms)=0 |
| | Generate a pair of asymmetric keys. More...
|
| |
| virtual void | deleteKeyPair (const Name &keyName)=0 |
| | Delete a pair of asymmetric keys. More...
|
| |
virtual ptr_lib::shared_ptr
< PublicKey > | getPublicKey (const Name &keyName)=0 |
| | Get the public key. More...
|
| |
| virtual Blob | sign (const uint8_t *data, size_t dataLength, const Name &keyName, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256)=0 |
| | Fetch the private key for keyName and sign the data, returning a signature Blob. More...
|
| |
|
Blob | sign (const Blob &data, const Name &keyName, DigestAlgorithm digestAlgorithm=DIGEST_ALGORITHM_SHA256) |
| |
| virtual Blob | decrypt (const Name &keyName, const uint8_t *data, size_t dataLength, bool isSymmetric=false)=0 |
| | Decrypt data. More...
|
| |
|
Blob | decrypt (const Name &keyName, const Blob &data, bool isSymmetric=false) |
| |
| virtual Blob | encrypt (const Name &keyName, const uint8_t *data, size_t dataLength, bool isSymmetric=false)=0 |
| | Encrypt data. More...
|
| |
|
Blob | encrypt (const Name &keyName, const Blob &data, bool isSymmetric=false) |
| |
| virtual void | generateKey (const Name &keyName, const KeyParams ¶ms)=0 |
| | Generate a symmetric key. More...
|
| |
| virtual bool | doesKeyExist (const Name &keyName, KeyClass keyClass)=0 |
| | Check if a particular key exists. More...
|
| |
| virtual Blob ndn::PrivateKeyStorage::decrypt |
( |
const Name & |
keyName, |
|
|
const uint8_t * |
data, |
|
|
size_t |
dataLength, |
|
|
bool |
isSymmetric = false |
|
) |
| |
|
pure virtual |
Decrypt data.
- Parameters
-
| keyName | The name of the decrypting key. |
| data | The byte to be decrypted. |
| dataLength | the length of data. |
| isSymmetric | If true symmetric encryption is used, otherwise asymmetric encryption is used. |
- Returns
- The decrypted data.
Implemented in ndn::MemoryPrivateKeyStorage, and ndn::FilePrivateKeyStorage.
| virtual void ndn::PrivateKeyStorage::deleteKeyPair |
( |
const Name & |
keyName | ) |
|
|
pure virtual |
| virtual bool ndn::PrivateKeyStorage::doesKeyExist |
( |
const Name & |
keyName, |
|
|
KeyClass |
keyClass |
|
) |
| |
|
pure virtual |
Check if a particular key exists.
- Parameters
-
| keyName | The name of the key. |
| keyClass | The class of the key, e.g. KEY_CLASS_PUBLIC, KEY_CLASS_PRIVATE, or KEY_CLASS_SYMMETRIC. |
- Returns
- True if the key exists, otherwise false.
Implemented in ndn::MemoryPrivateKeyStorage, and ndn::FilePrivateKeyStorage.
| virtual Blob ndn::PrivateKeyStorage::encrypt |
( |
const Name & |
keyName, |
|
|
const uint8_t * |
data, |
|
|
size_t |
dataLength, |
|
|
bool |
isSymmetric = false |
|
) |
| |
|
pure virtual |
Encrypt data.
- Parameters
-
| keyName | The name of the encrypting key. |
| data | The byte to be encrypted. |
| dataLength | the length of data. |
| isSymmetric | If true symmetric encryption is used, otherwise asymmetric encryption is used. |
- Returns
- The encrypted data.
Implemented in ndn::MemoryPrivateKeyStorage, and ndn::FilePrivateKeyStorage.
| virtual void ndn::PrivateKeyStorage::generateKey |
( |
const Name & |
keyName, |
|
|
const KeyParams & |
params |
|
) |
| |
|
pure virtual |
| virtual void ndn::PrivateKeyStorage::generateKeyPair |
( |
const Name & |
keyName, |
|
|
const KeyParams & |
params |
|
) |
| |
|
pure virtual |
| virtual ptr_lib::shared_ptr<PublicKey> ndn::PrivateKeyStorage::getPublicKey |
( |
const Name & |
keyName | ) |
|
|
pure virtual |
| virtual Blob ndn::PrivateKeyStorage::sign |
( |
const uint8_t * |
data, |
|
|
size_t |
dataLength, |
|
|
const Name & |
keyName, |
|
|
DigestAlgorithm |
digestAlgorithm = DIGEST_ALGORITHM_SHA256 |
|
) |
| |
|
pure virtual |
Fetch the private key for keyName and sign the data, returning a signature Blob.
- Parameters
-
| data | Pointer to the input byte array. |
| dataLength | The length of data. |
| keyName | The name of the signing key. |
| digestAlgorithm | the digest algorithm. |
- Returns
- The signature Blob.
Implemented in ndn::MemoryPrivateKeyStorage, and ndn::FilePrivateKeyStorage.
The documentation for this class was generated from the following files: