I was hoping that someone(possibly our the esteemed guests/authors-Jess and Daniel)- has sample code for generating a certificate. Tomcat 3.2.x has a certificate store and command line utilities for loading into the store-but I need to generate a certificate first. I've got an online shopping cart that I need to secure. I'm opting on this solution over using OpenSSL to generate certificates. I believe that the certificate would be generated using the java.security.cert.CertificateFactory class- but it would be nice to have a piece of code to chew on. Thanks Matt
Jess Garms
Author
Greenhorn
Joined: Jul 16, 2001
Posts: 17
posted
0
The command-line program keytool (shipped with JDK 1.2 and 1.3) will let you generate certificates. It's probably easier to use than to try to create them programmatically, unless you're looking to create a large number of certificates. CertificateFactory is actually for tranforming an encoded cert from a file or a stream into a Java object. The public Java APIs don't provide the ability to create a certificate from scratch.
Originally posted by Matthew Brown: I was hoping that someone(possibly our the esteemed guests/authors-Jess and Daniel)- has sample code for generating a certificate. Tomcat 3.2.x has a certificate store and command line utilities for loading into the store-but I need to generate a certificate first. I've got an online shopping cart that I need to secure. I'm opting on this solution over using OpenSSL to generate certificates. I believe that the certificate would be generated using the java.security.cert.CertificateFactory class- but it would be nice to have a piece of code to chew on. Thanks Matt
------------------
Jess Garms<br />Author of "<a href="http://www.amazon.com/exec/obidos/ASIN/1861004257/electricporkchop" target="_blank" rel="nofollow">Professional Java Security</a>"
Matthew X. Brown
Ranch Hand
Joined: Nov 08, 2000
Posts: 165
posted
0
Boy that shows you how much I know- I should really brush up on my Java Security. Could you recommend a book to help me ?
Jess Garms
Author
Greenhorn
Joined: Jul 16, 2001
Posts: 17
posted
0
Originally posted by Matthew Brown: Boy that shows you how much I know- I should really brush up on my Java Security. Could you recommend a book to help me ?
Heh. Well, I'd certainly recommend Professional Java Security, since I'm one of the authors. Seriously though, it contains plenty of information on how to set up your keystores to use the JSSE, including a number of examples.
Does anyone have any sample code for generating certificates completly w/ java... I do have the need to generate lots of certificates and I would much prefer to do it w/o calling outside applications.