From f40b4563c05739f94529df64a49f7425b490dd80 Mon Sep 17 00:00:00 2001 From: Eliott T Date: Thu, 24 Aug 2017 18:33:06 +0200 Subject: [PATCH] feat: add the ability to specify key type --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9a8983f..6ed8df9 100644 --- a/src/index.js +++ b/src/index.js @@ -133,9 +133,10 @@ exports.create = function (opts, callback) { } opts = opts || {} opts.bits = opts.bits || 2048 + opts.type = opts.type || 'RSA' waterfall([ - (cb) => crypto.keys.generateKeyPair('RSA', opts.bits, cb), + (cb) => crypto.keys.generateKeyPair(opts.type, opts.bits, cb), (privKey, cb) => privKey.public.hash((err, digest) => { cb(err, digest, privKey) })