Skip to content

Commit

Permalink
feat: Log certificates in example6.html
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed May 24, 2024
1 parent d3c4797 commit 9993338
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example6.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ <h2>Certificate chain building</h2>
}
}

// Log certificates
for (const [certId, cert] of certMap) {
console.log(`Certificate: ${certId}`);
console.log(` Subject: ${cert.subject}`);
console.log(` Issuer: ${cert.issuer}`);
console.log(` Serial: ${cert.serialNumber}`);
console.log(` Validity: ${cert.notBefore.toISOString()} - ${cert.notAfter.toISOString()}`);
console.log(cert.toString('pem'));
}

// Get selected certificate
const certId = $('certificates').value;
const cert = certMap.get(certId);
Expand Down

0 comments on commit 9993338

Please sign in to comment.