Topic: [SOLVED] Create CA certificate with ECC SHA512

Hi

I am working on CYASSL.  I want to create CA cert (and private key also) that use Elliptic Curve (SHA512_ECDSA). But I did not see any example about it in document and in the forum also..

Then, I had decided to write my own.. I upload my program in the attachment. My program did not work. Actually it creates certificate but I could not open it with openssl.. What is my problem.. Any Code snippet/examples? I need help, please help...


OpenSSL output,

>> openssl x509 -in cert.pem -text


unable to load certificate
9143:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:asn1_lib.c:142:
9143:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:1281:
9143:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:380:Type=X509
9143:error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:83:

Post's attachments

caCertGen.c 2.52 kb, 3 downloads since 2014-09-02 

You don't have the permssions to download the attachments of this post.

Share

Re: [SOLVED] Create CA certificate with ECC SHA512

Hi,

caCertGen.c is almost correct.  If you change the line

result = SignCert(...);

to

certSz = SignCert(...);

it should work because then the file write will have the correct size.

Regards,
-Todd

Share

Re: [SOLVED] Create CA certificate with ECC SHA512

Hi,

I change it, it should works but it didn't.
I got same error message when I try to open it with openssl whişch is shown below..
There is little/simple error, but I coulnt see!!

Regards,
Melek

unable to load certificate
9143:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:asn1_lib.c:142:
9143:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:1281:
9143:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:380:Type=X509
9143:error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:83:

Share

Re: [SOLVED] Create CA certificate with ECC SHA512

Ok, no problem I do it..

First of all, I create RNG, after I initialize ecc_key, then I fill and write certificate.

regards,
Melek

Share