get cert subject

This commit is contained in:
AJ ONeal 2016-08-09 14:48:50 -04:00
parent 19d6ac68de
commit 86f28ebbda
1 changed files with 4 additions and 0 deletions

View File

@ -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
};
};