#include <encryptor.hpp>
Public Member Functions | |
Encryptor (const Name &accessPrefix, const Name &ckPrefix, SigningInfo ckDataSigningInfo, const ErrorCallback &onFailure, Validator &validator, KeyChain &keyChain, Face &face) | |
~Encryptor () | |
InMemoryStorage::const_iterator | begin () const |
Returns begin iterator of the in-memory storage ordered by name with digest. More... | |
EncryptedContent | encrypt (span< const uint8_t > data) |
Synchronously encrypt supplied data. More... | |
InMemoryStorage::const_iterator | end () const |
Returns end iterator of the in-memory storage ordered by name with digest. More... | |
void | regenerateCk () |
Create a new content key and publish the corresponding CK data. More... | |
size_t | size () const |
NAC Encryptor.
Encryptor encrypts the requested content and returns an EncryptedContent element.
Definition at line 33 of file encryptor.hpp.
ndn::nac::Encryptor::Encryptor | ( | const Name & | accessPrefix, |
const Name & | ckPrefix, | ||
SigningInfo | ckDataSigningInfo, | ||
const ErrorCallback & | onFailure, | ||
Validator & | validator, | ||
KeyChain & | keyChain, | ||
Face & | face | ||
) |
accessPrefix | NAC prefix to fetch KEK (e.g., /access/prefix/NAC/data/subset) |
ckPrefix | Prefix under which Content Keys will be generated (each will have unique version appended) |
ckDataSigningInfo | SigningInfo parameters to sign CK Data |
onFailure | Callback to notify application of a failure to create CK data (failed to fetch KEK, failed to encrypt with KEK, etc.). Note that Encryptor will continue trying to retrieve KEK until success (each attempt separated by RETRY_DELAY_KEK_RETRIEVAL ) and onFailure may be called multiple times. |
validator | Validation policy to ensure correctness of KEK |
keyChain | KeyChain |
face | Face that will be used to fetch KEK and publish CK data |
Definition at line 36 of file encryptor.cpp.
ndn::nac::Encryptor::~Encryptor | ( | ) |
Definition at line 71 of file encryptor.cpp.
|
inline |
Returns begin iterator of the in-memory storage ordered by name with digest.
Definition at line 101 of file encryptor.hpp.
EncryptedContent ndn::nac::Encryptor::encrypt | ( | span< const uint8_t > | data | ) |
Synchronously encrypt supplied data.
If KEK has not been fetched already, this method will trigger async fetching of it. After KEK successfully fetched, CK data will be automatically published.
The actual encryption is done synchronously, but the exact KDK name is not known until KEK is fetched.
Note that if the KDK name is already known, this method will call onReady right away.
Definition at line 117 of file encryptor.cpp.
|
inline |
Returns end iterator of the in-memory storage ordered by name with digest.
Definition at line 112 of file encryptor.hpp.
void ndn::nac::Encryptor::regenerateCk | ( | ) |
Create a new content key and publish the corresponding CK data.
Definition at line 98 of file encryptor.cpp.
|
inline |
Definition at line 90 of file encryptor.hpp.