Amir Yiron wrote:

Hello,

I need my embedded application to be capable of creating a CA and creating SSL certificate.

My operating system is eCos, which means I don't have shell or any scripts, and I can't run utilities (However, I have a file system!).

I can only use a C interface.

I'm looking for a way to do what the 'openssl' utility does - just by calling OpenSSL library C functions.
e.g. I want to generate the CA root certificate and key,
so instead of calling:

openssl req -x509 -newkey rsa -out cacert.pem -outform PEM -days 1825

I want to do it in C code, probably by one of the following ways:

1. call the main code of the openssl utility as a function, and prepare an appropriate arg/argc arguments vector, or

2. call directly the specific C function for the specific openssl subcommand ('req' in this case) with appropriate parameters.

Note:

- I can't use Unix specific APIs like getenv();

- command execution cannot be interactive (command arguments and configuration files have to supply all required parameters)

Have a look at the source code (apps/req.c) how it is done in the utility. This is C-code and compilable on Windows.

Hope it helps
Ted
;)

--
PGP Public Key Information
Download complete Key from http://www.convey.de/ted/tedkey_convey.asc
Key fingerprint = 31B0 E029 BCF9 6605 DAC1  B2E1 0CC8 70F4 7AFB 8D26

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to