Topic: Getting public key from certificate with wolfSSL embedded SSL
Hi everyone,
I'm currently developed an application using wolfssl library and got some problem.
I want to encrypt some data with RSA. For this purpose I will use rsa function from ctaocrypt library.
My problem is how to get the public key from the certificate which is stored on the hard disk?
I try the following solution:
byte publicKeyBuffer[1024];
WOLFSSL_X509* x509cert = wolfSSL_X509_load_certificate_file("certAI.der", SSL_FILETYPE_ASN1);
publicKeyBuffer = wolfSSL_X509_get_pubkey(x509cert);
But wolfSSL_X509_get_pubkey(x509cert) return a WOLFSSL_EVP_PKEY* type which is not compatible with RsaPrivateKeyDecode function.
Any idea for a solution?
I have also some other problem but I will create new posts.
Thanks in advance,
Eric