minor cleanup
This commit is contained in:
parent
60e4ed8f7b
commit
17df564f69
|
@ -1,17 +0,0 @@
|
|||
/*!
|
||||
* letiny
|
||||
* Copyright(c) 2015 Anatol Sommer <anatol@anatol.at>
|
||||
* Some code used from https://github.com/letsencrypt/boulder/tree/master/test/js
|
||||
* MPL 2.0
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
exports.Acme = require('./acme-client');
|
||||
exports.registerNewAccount = require('./register-new-account');
|
||||
exports.getCertificate = require('./get-certificate');
|
||||
exports.getCert=function (options, cb) {
|
||||
exports.registerNewAccount(options, function () {
|
||||
exports.getCertificate(options, cb);
|
||||
});
|
||||
};
|
|
@ -17,6 +17,12 @@ function _toStandardBase64(str) {
|
|||
return b64;
|
||||
}
|
||||
|
||||
function certBufferToPem(cert) {
|
||||
cert = _toStandardBase64(cert.toString('base64'));
|
||||
cert = cert.match(/.{1,64}/g).join('\r\n');
|
||||
return '-----BEGIN CERTIFICATE-----\r\n'+cert+'\r\n-----END CERTIFICATE-----\r\n';
|
||||
}
|
||||
|
||||
module.exports.create = function (deps) {
|
||||
var request = deps.request;
|
||||
var Acme = deps.Acme;
|
||||
|
@ -402,11 +408,5 @@ module.exports.create = function (deps) {
|
|||
nextDomain();
|
||||
}
|
||||
|
||||
function certBufferToPem(cert) {
|
||||
cert=_toStandardBase64(cert.toString('base64'));
|
||||
cert=cert.match(/.{1,64}/g).join('\r\n');
|
||||
return '-----BEGIN CERTIFICATE-----\r\n'+cert+'\r\n-----END CERTIFICATE-----\r\n';
|
||||
}
|
||||
|
||||
return getCert;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue