workin' it

This commit is contained in:
AJ ONeal 2015-12-15 22:35:42 +00:00
parent e651755417
commit aec8958ca8
1 changed files with 99 additions and 98 deletions

View File

@ -6,11 +6,11 @@
*/ */
'use strict'; 'use strict';
module.exports.create = function (deps) {
var NOOP=function () {}, log=NOOP; var NOOP=function () {}, log=NOOP;
var request=require('request'); var request=require('request');
var cryptoUtil=require('./crypto-util'); var importPemPrivateKey=deps.leCrypto.importPemPrivateKey;
var Acme = require('./acme-client'); var Acme = deps.Acme;
function registerNewAccount(options, cb) { function registerNewAccount(options, cb) {
var state = {}; var state = {};
@ -32,7 +32,7 @@ function registerNewAccount(options, cb) {
} }
state.accountKeyPem=options.accountPrivateKeyPem; state.accountKeyPem=options.accountPrivateKeyPem;
state.accountKeyPair=cryptoUtil.importPemPrivateKey(state.accountKeyPem); state.accountKeyPair=importPemPrivateKey(state.accountKeyPem);
state.acme=new Acme(state.accountKeyPair); state.acme=new Acme(state.accountKeyPair);
register(); register();
@ -114,4 +114,5 @@ function registerNewAccount(options, cb) {
} }
} }
module.exports = registerNewAccount; return registerNewAccount;
};