use keytool provided by jdk for generating the certificate, you can sign your jar file with this certificate by using the jarsigner tool. Both keytool, jarsigner are available in bin folder of the jdk1.7.0 kit.
http://docs.oracle.com/javase/tutorial/security/toolsign/rstep2.html