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