从存储为文件的证书中获取属性
Get the properties from an certificate stored as file
我想在我的网站上显示上传到我的网络服务器上的证书。我考虑过向谁展示它的发行人,直到它有效为止。在 Windows 中,我只需双击它即可查看所有详细信息和属性,但如何使用 javascript 实现此目的?这可能吗?这只是 public 密钥,因此它不受密码保护。
假设证书的路径是 /certs/TestCert.cer
这是我暂时想出的一些虚拟代码,用于简要说明我的目标
function displayCertInfo(path) {
// get properties here
$issuedTo = /* get issued to property of the cert stored at path */
$validUntil = /* get valid until property of the cert stored at path */
document.write("Issued to " + $issuedTo)
document.write("Valid until " + $validUntil)
}
displayCertInfo("/certs/TestCert.cer")
我想在我的网站上显示上传到我的网络服务器上的证书。我考虑过向谁展示它的发行人,直到它有效为止。在 Windows 中,我只需双击它即可查看所有详细信息和属性,但如何使用 javascript 实现此目的?这可能吗?这只是 public 密钥,因此它不受密码保护。
假设证书的路径是 /certs/TestCert.cer
这是我暂时想出的一些虚拟代码,用于简要说明我的目标
function displayCertInfo(path) {
// get properties here
$issuedTo = /* get issued to property of the cert stored at path */
$validUntil = /* get valid until property of the cert stored at path */
document.write("Issued to " + $issuedTo)
document.write("Valid until " + $validUntil)
}
displayCertInfo("/certs/TestCert.cer")