How get encoding EC_params fro EC_KEY?

2008-05-20 Thread Mark Shnaider
Hello,
I can get  encoding of  an ANSI X9.62  ECDSA public key
from previously generated EC_KEY using function i2d_EC_PUBKEY.
Is where way to get Ec_params  encoding of  an ANSI X9.62  
 from EC_KEY?
I did not found function for this purpose.
Best regards
Mark

 

Mark Shnaider | Software engineer | ARX 
phone: +972.3.9279543 | mobile: +972.54.2448543 | email: [EMAIL PROTECTED] | 
www.arx.com 





How I can safe public and private of ES_KEY and create new ES_KEY for sign and verify

2008-05-15 Thread Mark Shnaider
Hello ,
I have problem in understanding and could you clarify for me what is the best 
way  to extract and safe  public and private keys
from  generated ES_KEY and then create new  key for signature or verify  .
Example esdatest.c:
if (!EC_KEY_generate_key(key))
goto x962_int_err;
BIO_printf(out, .);
 
If I would like to  create new ES_KEY for verify to my opinion I need to 
perform following actions:
  - Extract and safe  key-pub_key-X,  key-pub_key-Y, key-pub_key-Y to 
safeX,safeY,safeY

 And then in the other application perform:
   if ((new_key = EC_KEY_new_by_curve_name(nid)) == NULL)  //create new key for 
verify
goto x962_int_err;
pub_key = EC_POINT_new(new_key-group);
   -- copy big numbers safeX,safeY,safeY to pub_key-X,  pub_key-Y, pub_key-Y 

 EC_KEY_set_public_key(new_key, pub_key);

Can I use now new_key for verify?
Thanks in advance
Best regards
Mark




   





Mark Shnaider | Software engineer | ARX 
phone: +972.3.9279543 | mobile: +972.54.2448543 | email: [EMAIL PROTECTED] | 
www.arx.com