decryptEncryptionResultWithKey method

  1. @override
Future<Uint8List> decryptEncryptionResultWithKey(
  1. EncryptionResult encryptionResult,
  2. EncryptionKey key
)
inherited

decrypts a EncryptionResult object obtained from encryptWithKey() using key, use this method to avoid unnescessary serialisation/de-serilaisation during decryption

Implementation

@override
Future<Uint8List> decryptEncryptionResultWithKey(
    EncryptionResult encryptionResult, EncryptionKey key) async {
  assert(key is KeyPair, 'RSA decryption requires a `KeyPair`');
  final KeyPair keyPair = key as KeyPair;
  assert(
      keyPair.privateKey != null, 'Private key is required for decryption');
  return _decryptWithPrivateKey(
      keyPair.privateKey!, encryptionResult.cipherText);
}