Re: How to compute all attributes of RSA private key from modulus and private exponent?

2008-08-24 Thread delcour.pierre

delcour.pierre wrote:

Metalpalo wrote:

Hello

Ihave got one question:

Does exist some way how to compute all attributes of private key from
modulus and private exponent?
I think as public exponent, prime1, prime2, exp1, exp2...

Thanks  

My previous answer doesn't answer to your question, sorry, my mistake.

Have a nice day,
pierre
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: How to compute all attributes of RSA private key from modulus and private exponent?

2008-08-20 Thread delcour.pierre

Metalpalo wrote:

Hello

Ihave got one question:

Does exist some way how to compute all attributes of private key from
modulus and private exponent?
I think as public exponent, prime1, prime2, exp1, exp2...

Thanks
  

If you want to generate a rsa key with openssl code (not in line command) :

   RSA *rsa_ori = RSA_new(); // create a new rsa
   BIGNUM *e = BN_new();// create a new BN
   EVP_PKEY* key = EVP_PKEY_new();// create a blank one

   if (! BN_hex2bn(&e , /* the wanted exponent in char* , wrote in hexa 
i.e "010001"*/)) // set the BN value with the future exponent

   return -1; // Error : can't set the exponent
  
   if(! RSA_generate_key_ex(rsa_ori,/* int for the key length i.e 1024 
*/,e,NULL)) // if the generation runs badly -> throw error

   return -1; // Error : key can't be generated
   // if can't put private part of rsa in evp -> throw error
   if  (EVP_PKEY_set1_RSA(key, RSAPrivateKey_dup(rsa_ori)) <1)
return -1; // Error : key can't be set.
  
Here both RSA struct and EVP_PKEY struct contains all numbers needed to 
generate a rsa key.


I hope my answer help you ;)
Have a nice day,
pierre
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


How to compute all attributes of RSA private key from modulus and private exponent?

2008-08-19 Thread Metalpalo

Hello

Ihave got one question:

Does exist some way how to compute all attributes of private key from
modulus and private exponent?
I think as public exponent, prime1, prime2, exp1, exp2...

Thanks
-- 
View this message in context: 
http://www.nabble.com/How-to-compute-all-attributes-of-RSA-private-key-from-modulus-and-private-exponent--tp19063579p19063579.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]