encrypt method
EncryptionResult
encrypt(})
Encrypt content
Implementation
EncryptionResult encrypt(List<int> data,
{List<int>? initializationVector,
List<int>? additionalAuthenticatedData,
String? algorithm}) {
_assertCanDo('encrypt');
algorithm ??= this.algorithm;
var encrypter =
_keyPair.publicKey!.createEncrypter(_getAlgorithm(algorithm));
return encrypter.encrypt(Uint8List.fromList(data),
initializationVector: initializationVector != null
? Uint8List.fromList(initializationVector)
: null,
additionalAuthenticatedData: additionalAuthenticatedData != null
? Uint8List.fromList(additionalAuthenticatedData)
: null);
}