Hi,
Thanks for the reply .

Now below code is working fine. But is there any straight way get the
public key also?

void handleErrors(void){

printf("\n Error ");
}


void myPrint( BIGNUM * x, char * t ) {
   char * s = BN_bn2dec( x ) ;
   printf("%s%s", s, t ) ;
//   OPENSSL_free(s) ;
   free(s) ;
}

int main()
{

EC_KEY *key;

if(NULL == (key = EC_KEY_new_by_curve_name(NID_sect113r1)))
handleErrors();

if(1 != EC_KEY_generate_key(key)) handleErrors();

BIGNUM *prv = EC_KEY_get0_private_key(key);
BIGNUM *pub = EC_KEY_get0_public_key(key); //

*/* Is this the right way to get the public key or do I need to use
the Generator to get the public key*/ *

myPrint(prv,"\n"); // only this is printing properly
myPrint(pub,"\n");


return 0;

}


Rgds
Indra

Reply via email to