Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

JSSE sample code

 
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
 
Author
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
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"
 
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
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"
 
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
Boost this thread!