Wednesday, May 14, 2008

Java: Programmatically sign generated SSL certificates

I spent the major part of an afternoon trying to figure out how to do basic certificate authority operations, like certificate signing, programmatically in Java. After checking out the JDK source I found that sun.security.x509.X509CertImpl supports signing by a private key. Google found this code example for me:

http://www.java2s.com/Code/Java/Security/CertificateSigner.htm

Now that should fend off some 3rd party libraries for a while :)

Tuesday, May 13, 2008

SSL with FORM fallback

I struggled for a while to get SSL authentication with FORM fallback to work on tomcat. Sounds like something which must have been already implemented by someone, right? The latter is also true. The following are implementation and usage articles on the tomcat wiki:

Implementation:

http://wiki.apache.org/tomcat/SSLWithFORMFallback6

Usage:

http://wiki.apache.org/tomcat/SSLWithFORMFallback

For the usage part, it should suffice to just comment out the auth-method in your web.xml login-config.