In message <[EMAIL PROTECTED]> on Sat, 28 Feb 2004 15:55:10 +0800, "todayhill" <[EMAIL 
PROTECTED]> said:

todayhill> encrypt with RSA public key!
todayhill> but my public key come from a buffer,like char* buf,how can I use this buf 
encrypt my data?I know maybe use RSA struct,so how can I use that buf make a RSA 
struct? my key is in DER format.
todayhill> 

If it's a public key:

  unsigned char *p = rsabuf;
  RSA *rsa = d2i_RSAPublicKey(NULL, &p, rsabuf_len);

If it's a private key:

  unsigned char *p = rsabuf;
  RSA *rsa = d2i_RSAPrivateKey(NULL, &p, rsabuf_len);

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte   \ Tunnlandsvägen 52 \ [EMAIL PROTECTED]
[EMAIL PROTECTED]  \ S-168 36  BROMMA  \ T: +46-708-26 53 44
                    \      SWEDEN       \
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to