fix #1 return null when keypath cannot be derived

This commit is contained in:
AJ ONeal 2016-08-09 19:28:47 -06:00
parent 9d4ad0b734
commit c86cbd5edf
1 changed files with 3 additions and 0 deletions

View File

@ -144,6 +144,9 @@ module.exports.create = function (configs) {
, keypairs: {
checkAsync: function (keypath, format) {
if (!keypath) {
return null;
}
return fs.readFileAsync(keypath, 'ascii').then(function (key) {
if ('jwk' === format) {
return { privateKeyJwk: JSON.parse(key) };