How do I convert DER Format certificate x509 into human readable format?

时间秒杀一切 提交于 2020-01-07 08:32:59

问题


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);


来源:https://stackoverflow.com/questions/44586556/how-do-i-convert-der-format-certificate-x509-into-human-readable-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!