stuff
This commit is contained in:
parent
8535b2127c
commit
06822604a1
|
@ -48,15 +48,15 @@ certInfo.testGetCertInfo = function () {
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
var c = certInfo.testGetCertInfo();
|
var c = certInfo.testGetCertInfo();
|
||||||
|
|
||||||
console.log('');
|
console.info('');
|
||||||
|
|
||||||
console.log(c.notBefore.value);
|
console.info(c.notBefore.value);
|
||||||
console.log(Date(c.notBefore.value).valueOf());
|
console.info(Date(c.notBefore.value).valueOf());
|
||||||
|
|
||||||
console.log('');
|
console.info('');
|
||||||
|
|
||||||
console.log(c.notAfter.value);
|
console.info(c.notAfter.value);
|
||||||
console.log(Date(c.notAfter.value).valueOf());
|
console.info(Date(c.notAfter.value).valueOf());
|
||||||
|
|
||||||
console.log('');
|
console.info('');
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,10 @@ module.exports.create = function (le) {
|
||||||
var promise = le.store.accounts.checkKeypairAsync(args).then(function (keypair) {
|
var promise = le.store.accounts.checkKeypairAsync(args).then(function (keypair) {
|
||||||
return RSA.import(keypair);
|
return RSA.import(keypair);
|
||||||
}, function (/*err*/) {
|
}, 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) {
|
return RSA.generateKeypairAsync(args.rsaKeySize, 65537, keypairOpts).then(function (keypair) {
|
||||||
keypair.privateKeyPem = RSA.exportPrivatePem(keypair);
|
keypair.privateKeyPem = RSA.exportPrivatePem(keypair);
|
||||||
keypair.publicKeyPem = RSA.exportPublicPem(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) {
|
var promise = le.store.certificates.checkKeypairAsync(args).then(function (keypair) {
|
||||||
return RSA.import(keypair);
|
return RSA.import(keypair);
|
||||||
}, function (/*err*/) {
|
}, 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) {
|
return RSA.generateKeypairAsync(args.rsaKeySize, 65537, keypairOpts).then(function (keypair) {
|
||||||
keypair.privateKeyPem = RSA.exportPrivatePem(keypair);
|
keypair.privateKeyPem = RSA.exportPrivatePem(keypair);
|
||||||
keypair.publicKeyPem = RSA.exportPublicPem(keypair);
|
keypair.publicKeyPem = RSA.exportPublicPem(keypair);
|
||||||
|
|
Loading…
Reference in New Issue