Extracting Public key from the signed certificate

Hi Aric,
Note that your openssl command is not extracting the public key, but printing the certificate information, public key being one of them.
The Mbed TLS cert_app doesn’t print the key data. However, once parse, the structure for mbedtls_x509_crt contains an encapsulated member pk of type mbedtls_pk_context. This is the parsed public key of the certificate. You can then use the pk member as you see. Note this is an internal member, and it is not guaranteed that it will remain the same name \ location in structure, etc… However, since there is no APi to extract it, it will do for now.
You can look at Mbedtls_pk_context handling - #2 by roneld01 for some hints.
May I know why you need the certificate public key outside of the certificate verification?
Regards,
Mbed TLS Team member
Ron