make cert optional in get/set keypair

This commit is contained in:
Matt McKenna 2019-06-02 19:35:51 -07:00 committed by AJ ONeal
parent 7c350ff286
commit 83819b5901
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ const fileNames = require("../fileNames");
module.exports.checkKeypair = (opts, options) => {
console.log("certificates.checkKeypair for", opts.subject);
let id = opts.certificate.kid || opts.certificate.id || opts.subject;
let id = (opts.certificate && (opts.certificate.kid || opts.certificate.id)) || opts.subject;
let pemKeyPath = pathHelper.certificatesPath(options, id, fileNames.privkey.pem);
// let jwkKeyPath = pathHelper.certificatesPath(options, id, fileNames.privkey.jwk);

View File

@ -4,7 +4,7 @@ const pathHelper = require("../pathHelper");
const fileNames = require("../fileNames");
module.exports.setKeypair = (opts, options) => {
let id = opts.certificate.kid || opts.certificate.id || opts.subject;
let id = (opts.certificate && (opts.certificate.kid || opts.certificate.id)) || opts.subject;
console.log("certificates.setKeypair for", id);
let pemKeyPath = pathHelper.certificatesPath(options, id, fileNames.privkey.pem);