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,
}) {
return Isolate.run(
() => PqForgeStreamCipher.forProvider(engineProvider).decryptFile(
recipientSecretKey: recipientSecretKey,
recipientKexSecretKey: recipientKexSecretKey,
recipientKeyId: recipientKeyId,
input: File(inputPath),
output: File(outputPath),
signerPublicKey: signerPublicKey,
aadResolver: aad == null ? null : (_) => aad,
),
);
}