import type { BaseDigestOptions, CiphertextFormat } from '../types'; import type { Crypto } from '@peculiar/webcrypto'; import type { RsaCryptoKey } from './polyfill-libs/webcrypto-liner/mechs/rsa/key'; export declare type PemContent = string; export declare type PolyfillMap = Record; export declare type TextEncoderPolyfill = () => void; export declare type TextDecoderPolyfill = () => void; export declare type DigestPolyfill = (data: Uint8Array) => Uint8Array; export declare type EncryptPolyfill = (data: Uint8Array, key: CryptoKey) => Uint8Array; export declare type SignPolyfill = (data: Uint8Array, key: CryptoKey) => Uint8Array; export declare type VerifyPolyfill = (signature: ArrayBuffer, data: Uint8Array, key: CryptoKey) => boolean; export interface EncryptOptions { ciphertextFormat?: CiphertextFormat; encryptPolyfill?: EncryptPolyfill; digestPolyfill?: DigestPolyfill; textEncoderPolyfill?: TextEncoderPolyfill; } export interface DecryptOptions { ciphertextFormat?: CiphertextFormat; cryptoPolyfill?: Crypto; textDecoderPolyfill?: TextDecoderPolyfill; } export interface SignOptions { signPolyfill?: SignPolyfill; textEncoderPolyfill?: TextEncoderPolyfill; } export interface VerifyOptions { verifyPolyfill?: VerifyPolyfill; textEncoderPolyfill?: TextEncoderPolyfill; } export interface DigestParticularAlgoOptions extends BaseDigestOptions { digestPolyfill?: DigestPolyfill; textEncoderPolyfill?: TextEncoderPolyfill; } export interface DigestOptions extends DigestParticularAlgoOptions { algorithm?: HashAlgorithmIdentifier; } export declare type ImportPublicKeyPolyfill = (keyData: ArrayBuffer, algorithmConfig: RsaHashedImportParams, extractable: boolean, keyUsages: KeyUsage[]) => RsaCryptoKey; export interface ImportPublicKeyOptions { importPublicKeyPolyfill?: ImportPublicKeyPolyfill; algorithm?: string; hash?: HashAlgorithmIdentifier; } export declare type GenerateKeyPolyfill = () => CryptoKeyPair | CryptoKey; export interface GenerateKeyOptions { generateKeyPolyfill?: GenerateKeyPolyfill; extractable?: boolean; }