How can I convert a DER Format certificate x509 into a human readable format in JavaScript?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Javascript does not provide a method to parse certificate fields. You need to use a library like forge. I think you need something like this
var certAsn1 = forge.asn1.fromDer(certDer)
var cert = forge.pki.certificateFromAsn1(certAsn1);
console.log(cert.serialNumber);