decryptBytes static method

List<int> decryptBytes(
  1. CryptEnvelope envelope, {
  2. required Uint8List key,
})

Decifra envelope com key fornecida externamente e retorna os bytes originais.

Implementation

static List<int> decryptBytes(CryptEnvelope envelope,
    {required Uint8List key}) {
  final legacy = EncryptedPayload(
    algorithm: envelope.algorithm,
    ciphertext: envelope.ciphertext,
    key: key,
    nonce: envelope.nonce,
    tag: envelope.tag,
    aad: envelope.aad,
  );
  return CryptUtil.decryptAny(legacy);
}