Topic: [SOLVED] Adding a certificate to certs_test.h

This seems like a simple question but  I am lost for a solution.

I want to add a certificate to certs_test.h so that i can run an embedded code with NO_FILESYSTEM.

I have the certificate in .pem format or in .p12 format.

How do i add it into the file certs_test.h?  Straight copy/paste doesn't seem to work. Do I have to code it all by hand?

Thank you.

Share

Re: [SOLVED] Adding a certificate to certs_test.h

Hi will,

I recently had a forum topic on this exact issue.
https://www.wolfssl.com/forums/topic836 … ha256.html

If you still have questions let me know and I'll provide additional details.

Thanks, David Garske, wolfSSL

Share

Re: [SOLVED] Adding a certificate to certs_test.h

Hi David:

I don't know how to run the gencertbuf.pl script to produce the certs_test.h file. i know it is a pearl program but i get;" error no such file or directory at gencertbuf.pl line 54". I guess  i should have given the command line an input file and an output file but what is the format of the command line (I'm a newbie with pearl).

Thanks.

Will

Share

Re: [SOLVED] Adding a certificate to certs_test.h

Hi Will,

Please check out this webpage for a basic tutorial:
http://learn.perl.org/first_steps/

The script can be run directly and it will update certs_test.h.
./gencertbuf.pl

Thanks,
David Garske, wolfSSL

Share

Re: [SOLVED] Adding a certificate to certs_test.h

Hi David:

Thanks for that.  I got it  to run and generated a new certs_test.h file. However, I have an Apple certificate  (for push notifications) that I need to add to the certs_test.h file.  I converted the certificate file to  .der format and now I need to  add that file  in hex format into certs_test.h.

Can you suggest what i am doing wrong here?

Thanks. Will Hendrie

Share

Re: [SOLVED] Adding a certificate to certs_test.h

Hi Will,

You can see an example of how I added DER's for ECC certs/keys here:
https://github.com/dgarske/wolfssl/comm … ec3da4f289

If you are looking for a good tool to view/convert binary I like "Hex Fiend", but its for the Mac only.
Here is a good list of hex tools: https://en.wikipedia.org/wiki/Comparison_of_hex_editors

David

Share

Re: [SOLVED] Adding a certificate to certs_test.h

Hi David,

Thanks. I got the perl app running and added the .der certificate to my executable file.

That was a big help.

All the best.
Will

Share