decryptFile method
Decrypts file content in bytes format.
Provide cipherKey
to override Keyset.cipherKey.
If keyset
is not provided, then it tries to obtain a keyset using
name.
If that fails, then it uses the default keyset.
If that fails as well, then it will throw InvariantException.
Implementation
List<int> decryptFile(List<int> bytes,
{CipherKey? cipherKey, Keyset? keyset, String? using}) {
if (cipherKey != null) {
return _core.crypto.decryptFileData(cipherKey, bytes);
}
keyset ??= _core.keysets[using];
return keyset.cipherKey == _core.keysets.defaultKeyset.cipherKey
? _core.crypto.decrypt(bytes)
: _core.crypto.decryptFileData(keyset.cipherKey!, bytes);
}