backwards compat

This commit is contained in:
AJ ONeal 2016-08-01 20:31:43 -04:00
parent 36acd623ca
commit e8acedd6d7
1 changed files with 6 additions and 1 deletions

View File

@ -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=[];
}