decryptAsync method Null safety
- CryptoRSAPrivateKey key,
- Uint8List ciphertext
Implementation
static Future<Uint8List> decryptAsync(
CryptoRSAPrivateKey key, Uint8List ciphertext) {
Map<String, String> q = {};
q['ciphertext'] = base64.encode(ciphertext);
q['key'] = key.encode();
return compute(
(Map<String, String> q) => decrypt(
CryptoRSAPrivateKey.decode(q['key']!),
base64.decode(q['ciphertext']!)),
q)
.then((plaintext) => plaintext);
}