react-native-quick-crypto
Version:
A fast implementation of Node's `crypto` module written in C/C++ JSI
20 lines • 1.98 kB
TypeScript
import type { SubtleAlgorithm, KeyUsage, BinaryLike, BufferLike, JWK, AnyAlgorithm, ImportFormat, EncryptDecryptParams } from './utils';
import { CryptoKey } from './keys';
import type { CryptoKeyPair } from './utils/types';
export declare function isCryptoKeyPair(result: CryptoKey | CryptoKeyPair): result is CryptoKeyPair;
export declare class Subtle {
decrypt(algorithm: EncryptDecryptParams, key: CryptoKey, data: BufferLike): Promise<ArrayBuffer>;
digest(algorithm: SubtleAlgorithm | AnyAlgorithm, data: BufferLike): Promise<ArrayBuffer>;
deriveBits(algorithm: SubtleAlgorithm, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveKey(algorithm: SubtleAlgorithm, baseKey: CryptoKey, derivedKeyAlgorithm: SubtleAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
encrypt(algorithm: EncryptDecryptParams, key: CryptoKey, data: BufferLike): Promise<ArrayBuffer>;
exportKey(format: ImportFormat, key: CryptoKey): Promise<ArrayBuffer | JWK>;
wrapKey(format: ImportFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: EncryptDecryptParams): Promise<ArrayBuffer>;
unwrapKey(format: ImportFormat, wrappedKey: BufferLike, unwrappingKey: CryptoKey, unwrapAlgorithm: EncryptDecryptParams, unwrappedKeyAlgorithm: SubtleAlgorithm | AnyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
generateKey(algorithm: SubtleAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey | CryptoKeyPair>;
importKey(format: ImportFormat, data: BufferLike | BinaryLike | JWK, algorithm: SubtleAlgorithm | AnyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
sign(algorithm: SubtleAlgorithm, key: CryptoKey, data: BufferLike): Promise<ArrayBuffer>;
verify(algorithm: SubtleAlgorithm, key: CryptoKey, signature: BufferLike, data: BufferLike): Promise<boolean>;
}
export declare const subtle: Subtle;
//# sourceMappingURL=subtle.d.ts.map