UNPKG

@enactprotocol/security

Version:

Backend security library for signing enact documents

14 lines (13 loc) 591 B
export declare class CryptoUtils { static generateKeyPair(): { privateKey: string; publicKey: string; }; static getPublicKeyFromPrivate(privateKeyHex: string): string; static hash(data: string): string; static sign(privateKeyHex: string, messageHash: string): string; static verify(publicKeyHex: string, messageHash: string, signatureHex: string): boolean; static hexToPem(hexKey: string, type: 'PUBLIC' | 'PRIVATE'): string; static pemToHex(pemKey: string, type: 'PUBLIC' | 'PRIVATE'): string; static isPemFormat(key: string): boolean; }