decrypt method
Decrypt content and validate decryption, if applicable
Implementation
List<int> decrypt(List<int> data,
{List<int>? initializationVector,
List<int>? authenticationTag,
List<int>? additionalAuthenticatedData,
String? algorithm}) {
_assertCanDo('decrypt');
algorithm ??= this.algorithm;
var decrypter =
_keyPair.privateKey!.createEncrypter(_getAlgorithm(algorithm));
return decrypter.decrypt(EncryptionResult(Uint8List.fromList(data),
initializationVector: initializationVector != null
? Uint8List.fromList(initializationVector)
: null,
authenticationTag: authenticationTag != null
? Uint8List.fromList(authenticationTag)
: null,
additionalAuthenticatedData: additionalAuthenticatedData != null
? Uint8List.fromList(additionalAuthenticatedData)
: null));
}