views:

122

answers:

2

Hi, 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.

Thanks.

+1  A: 

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.

Vlad
+2  A: 

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.

Ernelli