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?


-- 
View this message in context: 
http://old.nabble.com/ECDSA-pub-priv-data-storage-Best-Practices-tp34477847p34477847.html
Sent from the OpenSSL - Dev mailing list archive at Nabble.com.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to