in src/main/java/com/amazonaws/encryptionsdk/internal/DecryptionHandler.java [116:145]
private DecryptionHandler(
final CMMHandler cmmHandler,
final CiphertextHeaders headers,
final CommitmentPolicy commitmentPolicy,
final SignaturePolicy signaturePolicy,
final int maxEncryptedDataKeys,
final Map<String, String> reproducedEncryptionContext)
throws AwsCryptoException {
Utils.assertNonNull(cmmHandler, "materialsManager");
Utils.assertNonNull(commitmentPolicy, "commitmentPolicy");
Utils.assertNonNull(signaturePolicy, "signaturePolicy");
cmmHandler_ = cmmHandler;
ciphertextHeaders_ = headers;
commitmentPolicy_ = commitmentPolicy;
signaturePolicy_ = signaturePolicy;
maxEncryptedDataKeys_ = maxEncryptedDataKeys;
ciphertextFooters_ = new CiphertextFooters();
if (headers instanceof ParsedCiphertext) {
ciphertextBytesSupplied_ = ((ParsedCiphertext) headers).getOffset();
} else {
// This is a little more expensive, hence the public create(...) methods
// that take a CiphertextHeaders instead of a ParsedCiphertext are
// deprecated.
ciphertextBytesSupplied_ = headers.toByteArray().length;
}
reproducedEncryptionContext_ = reproducedEncryptionContext;
readHeaderFields(headers);
updateTrailingSignature(headers);
}