开发者

Details in hex of the certificate in .pem openssl

开发者 https://www.devze.com 2022-12-25 00:28 出处:网络
I have generated using openssl mycert.pem which contents the certificate. And I converted the base64 text into hex.

I have generated using openssl mycert.pem which contents the certificate. And I converted the base64 text into hex.

I wonder if it's possible to extract the informations from the hex string in c (without using the openssl library). For example, the public key, the issuer, the subject, the validity information, etc.

Tha开发者_如何学编程nks.


Yes but it is very cumbersome. You have to implement an ASN1 parser apart from the Base64 unencoding.

You might find shortcuts where you can extract certain parts of the certificate without using a full ASN1 parser.

The ASN1 protocol format contains structured data where parts can be skipped without being fully decoded since each header of each entry containins a size field, so you might for example skip parts of a certificate that is not of your interest.


Of course you can parse. However X509 is not the easiest format to parse. Here is a reference to the RFC that should help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号