UNPKG

will-lib

Version:
15 lines (14 loc) 502 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KeyTool = void 0; const NodeRSA = require('node-rsa'); class KeyTool { static generateKeyPair(bits = 1024) { const key = new NodeRSA(); key.generateKeyPair(bits); let publicKey = key.exportKey("pkcs8-public-pem"); let privateKey = key.exportKey("pkcs8-private-pem"); return { publicKey: publicKey, privateKey: privateKey }; } } exports.KeyTool = KeyTool;