feat: pass options to downstream decryptor

This commit is contained in:
鲁树人
2023-06-10 12:06:02 +01:00
parent 0038322ae9
commit 865dcae931
7 changed files with 49 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
import type { DecryptCommandOptions } from '~/decrypt-worker/types';
export interface CryptoBase {
cryptoName: string;
checkByDecryptHeader: boolean;
@@ -8,8 +10,8 @@ export interface CryptoBase {
*/
overrideExtension?: string;
checkBySignature?: (buffer: ArrayBuffer) => Promise<boolean>;
decrypt(buffer: ArrayBuffer, blob: Blob): Promise<Blob | ArrayBuffer>;
checkBySignature?: (buffer: ArrayBuffer, options: DecryptCommandOptions) => Promise<boolean>;
decrypt(buffer: ArrayBuffer, options: DecryptCommandOptions): Promise<Blob | ArrayBuffer>;
}
export type CryptoFactory = () => CryptoBase;