@enactprotocol/security
Version:
Backend security library for signing enact documents
20 lines (19 loc) • 710 B
TypeScript
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;
}
export declare namespace CryptoUtils {
type PrivateKey = {
fileName: string;
key: string;
};
}