UNPKG

@ne1410s/crypto

Version:

Lightweight ES5 script to provide crypto utilities

12 lines (11 loc) 816 B
import { IKeyPair_Jwk, ICsr_Params, ICsr_Result } from './interfaces'; import { JsonWebKey } from 'node:crypto'; export declare function randomString(): Promise<string>; export declare function gen(): Promise<IKeyPair_Jwk>; export declare function sign(text: string, privateJwk: JsonWebKey): Promise<string>; export declare function digest(text: string): Promise<string>; export declare function csr(params: ICsr_Params): Promise<ICsr_Result>; export declare function pfx(friendlyName: string, cert_b64: string, key_b64: string, password: string, hash?: string): Promise<ArrayBuffer>; export declare function pemToBase64Parts(pem: string): Array<string>; export declare function base64ToPem(base64: string, title: string): string; export declare function bufferToPem(pkcs10_buf: ArrayBuffer, title: string): string;