react-native-quick-crypto
Version:
A fast implementation of Node's `crypto` module written in C/C++ JSI
29 lines • 1.08 kB
TypeScript
import { Buffer } from '@craftzdog/react-native-buffer';
import { KeyObject, CryptoKey } from './classes';
import type { BinaryLike } from '../utils';
type KeyInput = BinaryLike | KeyObject | CryptoKey | KeyInputObject;
interface KeyInputObject {
key: BinaryLike | KeyObject | CryptoKey;
format?: 'pem' | 'der';
type?: 'pkcs1' | 'pkcs8' | 'spki' | 'sec1';
passphrase?: BinaryLike;
padding?: number;
saltLength?: number;
dsaEncoding?: 'der' | 'ieee-p1363';
}
export declare class Sign {
private handle;
constructor(algorithm: string);
update(data: BinaryLike): this;
sign(privateKey: KeyInput, outputEncoding?: BufferEncoding): Buffer;
}
export declare class Verify {
private handle;
constructor(algorithm: string);
update(data: BinaryLike): this;
verify(publicKey: KeyInput, signature: BinaryLike, signatureEncoding?: BufferEncoding): boolean;
}
export declare function createSign(algorithm: string): Sign;
export declare function createVerify(algorithm: string): Verify;
export {};
//# sourceMappingURL=signVerify.d.ts.map