diff --git a/lib/format.js b/lib/format.js index d184564..5a0c03c 100644 --- a/lib/format.js +++ b/lib/format.js @@ -9,7 +9,7 @@ module.exports = format function format(crt) { - return [subject, pem].map(function(cb) + return [subject, valid, pem].map(function(cb) { return cb(crt) }) @@ -23,9 +23,19 @@ function pem(crt) function subject(crt) { - return crt.subject.attributes.map(function(rdn) + return 'Subject: ' + crt.subject.attributes.map(function(rdn) { return '/' + (rdn.shortName || rdn.name)+ '=' + rdn.value }) .join('') } + +function valid(crt) +{ + var x = crt.validity + var a = [] + for(var k in x) + a.push(x[k].toISOString()) + return 'Valid: ' + + a.join(' - ') +}