On 9/25/2012 9:51 AM, redpath wrote:
I have saved the private and public key of the ECDSA;
Just sample code below.
int len= i2o_ECPublicKey(eckey,NULL);
unsigned char *buf=(unsigned char *)0;
ret= i2o_ECPublicKey(eckey,( unsigned char **)&buf);
if (!ret){
printf("Public key to octect string failed\n");
return 1;
}
printf("\ni2o public\n");
for (int i=0; i<len; i++)
printf("%X ",buf[i]);
printf("\n\n");
printf("started SHA1\n");
fp = fopen(args[1],"wb");
if (fp==NULL){
printf("Public file [%s] failed to create\n",args[1]);
return 1;
}
fwrite(buf,1,len,fp);
fclose(fp);
And have used this public key to check signature simply by reading the file
back
as data to "pubdata" using this function.
pubkey= o2i_ECPublicKey(&pubkey, (const unsigned char **)&pubdata, publen);
But what is the best packaging for this Public key as in handing it out?
I can simply provide this file but is there some packaging format generally
used as Best Practices?
How about:
http://www.ietf.org/rfc/rfc5480.txt
--
Douglas E. Engert <[email protected]>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439
(630) 252-5444
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]