get cert subject
This commit is contained in:
parent
19d6ac68de
commit
86f28ebbda
|
@ -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
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue