Topic: [RSA] How to convert a RAW public key to DER format

Hello,

I'm new on the forum and a new user of WolfSSL.

Currently I try to encode a RAW RSA public key (n and e) to a DER format. I have seen the API named
WOLFSSL_API int wc_RsaKeyToDer( RsaKey *      , byte *      output, word32      inLen );

The doc indicate
"This function converts an RsaKey key to DER format. The result is written to output and it returns the number of bytes written."

So it seems to be a good candaidate to do what I want.

But (and this is my question):

If I fill the RsaKey structure with my RAW public key only, the résulting DER encoding will be only formatted for a public key or an error will be occur or DER bytes for private key will be present too ?

Thanks for your help.

Sebastien

Share

Re: [RSA] How to convert a RAW public key to DER format

Sorry after some research I have found wc_RsaKeyToPublicDer() which seems to do the job.

Share