Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSSE sample code

 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


------------------
 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

------------------
Jess Garms
Author of "Professional Java Security"
 
James Nuzzi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Does your book have any information on accessing directory servers using LDAP over SSL?

------------------

James Nuzzi
SCJP, SCJD, SCWCD
 
Jess Garms
Author
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by James Nuzzi:
Hi,
Does your book have any information on accessing directory servers using LDAP over SSL?


Afraid not, sorry. There's general information on using SSL as both client and server, but nothing specific to LDAP.

------------------
Jess Garms
Author of "Professional Java Security"
 
Sean Bruton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic