//产生密钥,密钥别名为joe,口令为sign12,存放在密钥库joestore中
keytool -genkey -alias joe -keypass sign12 -keystore joestore
//将SignedApplet.class及相关文件打包成jar文件
jar cvf SignedAppletDemo.jar
//利用keytool生成的自签名的证书产生签名applet(jar文件)
jarsigner -keystore joestore -signedjar joe.jar SignedAppletDemo.jar joe
//将自签名证书从keystore中输出到文件
keytool -export -keystore joestore -alias joe -file joe.cer
而对于签名applet的接受方Susan,需要通过如下步骤来安全地执行
Joe编写的签名applet:
//得到Joe的证书并将之读入到密钥库中susanstore中
keytool -import -alias joe -file joe.cer -keystore susanstore
//运行policytool产生满足Susan要求的policy文件
policytool
//用appletviewer运行之,或在浏览器中安装java plugin来运行之.
web start中的签名
最新推荐文章于 2021-02-25 02:32:37 发布