From 06822604a12d83b958d095c917ceb0394c56b7a4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 8 Aug 2016 19:43:31 -0400 Subject: [PATCH] stuff --- lib/cert-info.js | 14 +++++++------- lib/core.js | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/cert-info.js b/lib/cert-info.js index 50bd31c..b7bc669 100644 --- a/lib/cert-info.js +++ b/lib/cert-info.js @@ -48,15 +48,15 @@ certInfo.testGetCertInfo = function () { if (require.main === module) { var c = certInfo.testGetCertInfo(); - console.log(''); + console.info(''); - console.log(c.notBefore.value); - console.log(Date(c.notBefore.value).valueOf()); + console.info(c.notBefore.value); + console.info(Date(c.notBefore.value).valueOf()); - console.log(''); + console.info(''); - console.log(c.notAfter.value); - console.log(Date(c.notAfter.value).valueOf()); + console.info(c.notAfter.value); + console.info(Date(c.notAfter.value).valueOf()); - console.log(''); + console.info(''); } diff --git a/lib/core.js b/lib/core.js index 2b0b7c6..89ed823 100644 --- a/lib/core.js +++ b/lib/core.js @@ -57,6 +57,10 @@ module.exports.create = function (le) { var promise = le.store.accounts.checkKeypairAsync(args).then(function (keypair) { return RSA.import(keypair); }, function (/*err*/) { + if (args.accountKeypair) { + return le.store.accounts.setKeypairAsync(args, RSA.import(args.accountKeypair)); + } + return RSA.generateKeypairAsync(args.rsaKeySize, 65537, keypairOpts).then(function (keypair) { keypair.privateKeyPem = RSA.exportPrivatePem(keypair); keypair.publicKeyPem = RSA.exportPublicPem(keypair); @@ -174,6 +178,10 @@ module.exports.create = function (le) { var promise = le.store.certificates.checkKeypairAsync(args).then(function (keypair) { return RSA.import(keypair); }, function (/*err*/) { + if (args.domainKeypair) { + return le.store.certificates.setKeypairAsync(args, RSA.import(args.domainKeypair)); + } + return RSA.generateKeypairAsync(args.rsaKeySize, 65537, keypairOpts).then(function (keypair) { keypair.privateKeyPem = RSA.exportPrivatePem(keypair); keypair.publicKeyPem = RSA.exportPublicPem(keypair);