> [steve - Mon Mar 01 14:57:21 2010]:
> 
Darn message got cut short... continued.

> 
> You can do this:
> 
> ret = RSA_public_encrypt(key_len, key, encrypted_key, key->pkey.rsa, 
> RSA_PKCS1_PADDING);
> 

Which is a drop in replacement for what you already in there. It
accesses the internals of "key" but that will work in all existing
versions of OpenSSL unless EVP_PKEY is made an opaque structure in
future. However a better way is:

RSA *tkey = EVP_PKEY_get1_RSA(pkey);
ret = RSA_public_encrypt(key_len, key, encrypted_key, key->pkey.rsa, 
RSA_PKCS1_PADDING);






-- 
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to