I'm working on a firmware for a platform with limited resources with C as programming language.
There are a set of cryptographic primitives to be implemented, including AES, GCM/GMAC, ECDSA, ECDH. Our hardware allows to handle all these algorithms (it is more or less a crypto controller) and all the mentioned things beside ECDH are already implemented and tested.
For a future firmware release certificate handling (only for ECC with P256/SHA256, including also certificates in the validation chain) is needed as an additional requirement.
What is the best approach to parse certificates into its atomic constituents. E.g. I need access to public key material, like expiration date, issuer, subject , ...
Of course, I know about openSSL, but this is too heavy and would blow up far too much. So I tested mbedSSL (under Apache license). This open source project would do it, but I'm not allowed to use it because of internal reasons. Similar for woolfSSL. Anyway, I would only use a very small part of such library (just parsing of certificates)...
Is there some recommended way to parse a PEM X.509 certificate? Any third party product I can use? Is it complicated to write such parser on my own? Where is the structure described? My biggest concern is about writing a good ANS1 parser together with a base64 decoder on my ow, but maybe it is not that complicated as I expect from now.