decryptFileInBackground static method
Runs decryptFile on a background isolate (Axis A offload).
aad is the already-resolved associated data; read the header first (see
readHeader) when it depends on the envelope's metadata.
Implementation
static Future<PqStreamingHeader> decryptFileInBackground({
required Uint8List recipientSecretKey,
required String inputPath,
required String outputPath,
Uint8List? recipientKexSecretKey,
String? recipientKeyId,
Uint8List? signerPublicKey,
Uint8List? aad,
PqForgeEngineProvider engineProvider =
PqForgeEngineProvider.nativeCryptography,
}) {
final fips = PqFipsMode.isEnabled;
_requireSendableRandom();
return Isolate.run(() {
if (fips) PqFipsMode.enable();
return PqForgeStreamCipher.forProvider(engineProvider).decryptFile(
recipientSecretKey: recipientSecretKey,
recipientKexSecretKey: recipientKexSecretKey,
recipientKeyId: recipientKeyId,
input: File(inputPath),
output: File(outputPath),
signerPublicKey: signerPublicKey,
aadResolver: aad == null ? null : (_) => aad,
);
});
}