From 86f28ebbda75bcbd02c6b110895050fd3352763c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 9 Aug 2016 14:48:50 -0400 Subject: [PATCH] get cert subject --- lib/cert-info.js | 4 ++++ 1 file changed, 4 insertions(+) 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 }; };