>> 
>> Well... actually there is no RSA_dup() either :-)...... but the following
>> should works as well:
>> ....
>> EVP_PKEY* pDupKey = EVP_PKEY_new();
>> RSA* pRSA = EVP_PKEY_get1_RSA(pKey);
>> EVP_PKEY_set1_RSA(pDupKey, pRSA);
>> RSA_free(pRSA);
>> return(pDupKey);
>> 

>Well that will just end up with two distinct EVP_PKEY structures
>referencing the same 'rsa' structure with an upped reference count. If
>you're going to do that then you might as well just up the reference
>count of the EVP_PKEY structure.

>Now I've looked at it RSA_dup() is a non trivial problem when it deals
>with things like hardware keys.

Sorry....
You're right, of course.
I have no idea why this works though, since I end up with freeing the RSA
part of the EVP_PKEY??
But anyway.....
Do you have any suggestions, how to properly implement the RSA_dup()
function you suggested earlier, assuming that we are only talking software
keys?

Thanks,
Kim Hellan
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to