From e8acedd6d7fa7a6de5994207e4064002b5d8b339 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 1 Aug 2016 20:31:43 -0400 Subject: [PATCH] backwards compat --- lib/acme-client.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/acme-client.js b/lib/acme-client.js index 5dd199f..1bb3794 100644 --- a/lib/acme-client.js +++ b/lib/acme-client.js @@ -11,9 +11,14 @@ module.exports.create = function (deps) { var NOOP=function () {}; var log=NOOP; var request=require('request'); - var generateSignature=deps.RSA.signJws; + var RSA = deps.RSA; + var generateSignature = RSA.signJws; function Acme(keypair) { + if ('string' === typeof keypair) { + // backwards compat + keypair = RSA.import({ privateKeyPem: keypair }); + } this.keypair = keypair; this.nonces=[]; }