On Mon, Mar 07, 2005, Lee Jenkins wrote:

> 
> 
> Hello all,
> 
> I am using the following commands to create a self-cert:
> 
> *******************************************************************
> req -config openssl.cnf -new -out myserver.csr
> 
> rsa -in privkey.pem -out key.pem
> 
> x509 -in myserver.csr -out cert.pem -req -signkey key.pem -days 365
> *******************************************************************
> 
> I would like to be able to perform this through code (Win32 Delphi App).
> Shelling out to openssl.exe is no problem.  What I am not sure about is the
> second command, "rsa -in privkey.pem -out key.pem", which successively
> prompts for data.  Is there a way that I can feed this data (passphrase,
> State, City, common name, etc) to the command line through a text file or
> such?
> 
> I've looked through the command line params docs, but didn't notice
> anything.
> 

The -passin command line switch will do that but...

That command sequence would give you an obsolete V1 certificate so its not
a good idea.

You can do the whole thing in a single command by using the -x509 option to
'req'. You might want to use alternative extensions though because that will
use CA ones by default.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to