diff --git a/lib/cert-info.js b/lib/cert-info.js index 3664fb3..8672112 100644 --- a/lib/cert-info.js +++ b/lib/cert-info.js @@ -38,6 +38,7 @@ certInfo.getCertInfo = function (pem) { certInfo.getBasicInfo = function (pem) { var c = certInfo.getCertInfo(pem); var domains = []; + var sub; c.extensions.forEach(function (ext) { if (ext.parsedValue && ext.parsedValue.altNames) { @@ -47,10 +48,13 @@ certInfo.getBasicInfo = function (pem) { } }); + sub = c.subject.types_and_values[0].value.value_block.value || null; + return { issuedAt: c.notBefore.value , expiresAt: c.notAfter.value , domains: domains + , subject: sub }; };