OpenSSL
感谢:[url]http://emo.sourceforge.net/cert-login-howto.html[/url] 有些命令参数有变化,自己整理了下过程 1.Create OpenSSL keys and request -- run OpenSSL as administrator 1).openssl> req -new -newkey rsa:1024 -nodes -out ca.csr -keyout ca.key 2).openssl> x509 -trustout -signkey ca.key -days 1825 -req -in ca.csr -out ca.pem 3).Create txt file named "ca.srl" and give the file the contents "02" and save it 2.Create a server certificate and keystore 1).go to the %JAVA_HOME%/jre/bin folder run keytool command as administrator >keytool -genkey -alias tomcat -keyalg RSA -keysize 1024 -validity 365 -keystore tomcat.keystore 2).Next we import the certificate created in OpenSSL: >keytool -import -keystore tomcat.keystore -file ca.pem 3.Configure the application server 4.Set Up Client Authentication 1).openssl> req -new -newkey rsa:1024 -nodes -out client1.req -keyout client1.key 2).openssl> x509 -CA ca.pem -CAkey ca.key -CAserial ca.srl -req -in client1.req -out client1.pem 3).openssl> pkcs12 -export -in client1.pem -inkey client1.key -out client1.p12 -name "Sample Client Cert" If you are using the Firefox browser, you can reach this via Tools -> Options. Click on the Advanced tab,and click "Encryption" and click on the "View Certificates" button. The screen displayed will have the option to import a new certificate.