20 #ifndef NDN_NAC_DECRYPTOR_HPP
21 #define NDN_NAC_DECRYPTOR_HPP
49 Decryptor(
const Key& credentialsKey, Validator& validator, KeyChain& keyChain, Face& face);
57 decrypt(
const Block& encryptedContent,
63 bool isRetrieved =
false;
65 std::optional<PendingInterestHandle> pendingInterest;
73 std::list<PendingDecrypt> pendingDecrypts;
76 using ContentKeys = std::map<Name, ContentKey>;
79 fetchCk(ContentKeys::iterator ck,
const ErrorCallback& onFailure,
size_t nTriesLeft);
82 fetchKdk(ContentKeys::iterator ck,
const Name& kdkPrefix,
const Data& ckData,
86 decryptAndImportKdk(
const Data& kdkData,
const ErrorCallback& onFailure);
89 decryptCkAndProcessPendingDecrypts(ContentKeys::iterator ck,
const Data& ckData,
90 const Name& kdkKeyName,
102 Key m_credentialsKey;
105 KeyChain& m_keyChain;
106 KeyChain m_internalKeyChain;
Decryptor(const Key &credentialsKey, Validator &validator, KeyChain &keyChain, Face &face)
Constructor.
void decrypt(const Block &encryptedContent, const DecryptSuccessCallback &onSuccess, const ErrorCallback &onFailure)
Asynchronously decrypt encryptedContent.
std::function< void(ConstBufferPtr)> DecryptSuccessCallback
std::function< void(const ErrorCode &, const std::string &)> ErrorCallback
DecryptSuccessCallback onSuccess
EncryptedContent encryptedContent