I see that PEM_read_RSAPrivateKey  looks like the one I need.

Thanx,
Tomar

Nagendra Tomar <[EMAIL PROTECTED]> wrote: Hi
    I would like to know if there is a libcrypto  API to read a public/private 
key from a keyfile and populate the RSA structure, so that one can do
other operations (encrypt, sign, decrypt, verify) using that RSA struct.

    What I am looking for is an equivalent of SSL_use_RSAPrivateKey_file for 
the RSA context.  

IOW, one can call RSA_generate_key() to get an RSA structure which is already 
loaded with the RSA keys and hence can be directly used as a valid argument  to 
RSA_{public|private}_encrypt, 
RSA_{public|private}_decrypt, RSA_sign and RSA_verify functions.
        But if I have an already generated key (common case) which I would like 
to be used for the above operations, how do I get that key inside the RSA 
struct.
    I've noticed that programs which need to do this, e.g. openssl, openssh 
etc, they all do it by hand, reading the key from the file  and populating the 
RSA struct.
        Is there are API for doing this and if not, I would be curious to know 
why, as this seems like a very common use-case to me.

Thanx,
Tomar

         

---------------------------------
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre.

       
---------------------------------
 Copy addresses and emails from any email account to Yahoo! Mail - quick, easy 
and free. Do it now...

Reply via email to