UNPKG

react-native-quick-crypto

Version:

A fast implementation of Node's `crypto` module written in C/C++ JSI

82 lines 2.91 kB
import { Buffer } from 'buffer'; import type { AsymmetricKeyType, EncodingOptions, KeyDetail, KeyObjectHandle, KeyUsage, SubtleAlgorithm } from '../utils'; import { KFormatType, KeyEncoding } from '../utils'; export declare class CryptoKey { keyObject: KeyObject; keyAlgorithm: SubtleAlgorithm; keyUsages: KeyUsage[]; keyExtractable: boolean; get [Symbol.toStringTag](): string; constructor(keyObject: KeyObject, keyAlgorithm: SubtleAlgorithm, keyUsages: KeyUsage[], keyExtractable: boolean); inspect(_depth: number, _options: unknown): unknown; get type(): "public" | "secret" | "private"; get extractable(): boolean; get algorithm(): SubtleAlgorithm; get usages(): KeyUsage[]; } export declare class KeyObject { handle: KeyObjectHandle; type: 'public' | 'secret' | 'private'; get [Symbol.toStringTag](): string; export(options: { format: 'pem'; } & EncodingOptions): string | Buffer; export(options?: { format: 'der'; } & EncodingOptions): Buffer; export(options?: { format: 'jwk'; } & EncodingOptions): never; export(options?: EncodingOptions): string | Buffer; constructor(type: string, handle: KeyObjectHandle); constructor(type: string, key: ArrayBuffer); static createKeyObject(type: string, key: ArrayBuffer, format?: KFormatType, encoding?: KeyEncoding): KeyObject; getAsymmetricKeyType(): undefined; getAsymmetricKeyDetails(): undefined; } export declare class SecretKeyObject extends KeyObject { constructor(handle: KeyObjectHandle); export(options: { format: 'pem'; } & EncodingOptions): never; export(options: { format: 'der'; } & EncodingOptions): Buffer; export(options: { format: 'jwk'; } & EncodingOptions): never; export(options?: EncodingOptions): Buffer; } export declare class AsymmetricKeyObject extends KeyObject { constructor(type: string, handle: KeyObjectHandle); private _asymmetricKeyType?; get asymmetricKeyType(): AsymmetricKeyType; private _asymmetricKeyDetails?; get asymmetricKeyDetails(): KeyDetail; get namedCurve(): string | undefined; } export declare class PublicKeyObject extends AsymmetricKeyObject { constructor(handle: KeyObjectHandle); export(options: { format: 'pem'; } & EncodingOptions): string; export(options: { format: 'der'; } & EncodingOptions): Buffer; export(options: { format: 'jwk'; } & EncodingOptions): never; } export declare class PrivateKeyObject extends AsymmetricKeyObject { constructor(handle: KeyObjectHandle); export(options: { format: 'pem'; } & EncodingOptions): string; export(options: { format: 'der'; } & EncodingOptions): Buffer; export(options: { format: 'jwk'; } & EncodingOptions): never; } //# sourceMappingURL=classes.d.ts.map