你签名时不是用的同一个keystore吧
解决方案 »
- Invalid maximun heap size:-Xmx128Mb
- 求助啊
- 判断两字符是否相等
- 初学structs+string+hibernate框架,请问学习方和和步骤是什么?
- 关于对帐功能的实现
- 编写的小应用程序用appletviewer来检查,一切正常。但在IE上查看时一直显示Loding images...,请问这是为什么?
- 探讨:如何有效的学习J2EE(大家进来说说 ,UP 者有分)!
- 哪里有Borland OptimizeIt 5.5 的Crack下载?
- 在java中,我要输出一个字符串,可字符串太长,我想换一行。该如何做?
- 保留字synchronized的作用?
- 用JSP+SQL做论坛需要什么样的环境?
- javah Hello 为什么出错:Class Hello could not be found
数字签名
用Applet写的java小程序如果没有经过签名,那么访问客户端程序下载后会受到安全限制;怎样对java小程序签名受到很多人的关注,网上也有这些方面可供参考的文档,但都不是完整,在这里我给出一份可具体操作的文档,希望能给大家一些帮助。 场景:test.jar:内含待签名的java小程序 结果:签名后,客户端能自动下载java小程序,且java小程序能访问客户端的任何资源 步骤: (1)将java小程序打包 jar cvf test.jar test.class (2)生成名为chinani.store的密钥库,别名为chinani keytool -genkey -keystore chinani.store -alias chinani 密码:123456 (根据需要自己输入) 以下根据需要输入,最后确认:y (3)导出chinani.cer数字证书 keytool -export -keystore chinani.store -alias chinani -file chinani.cer 密码:123456 (根据需要自己输入) (4)对test.jar文件进行签名 jarsigner -keystore chinani.store test.jar chinani 密码:123456 (根据需要自己输入) 最后写一个html文件,运行此文件即可自动下载安装运行java小程序<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> <!--能自动下载jre包--> <OBJECT classid="clsid:CAFEEFAC-0014-0000-0000-ABCDEFFEDCBA" WIDTH = 300 HEIGHT = 300 codebase="jinstall-1_4_0-win.cab#Version=1,4,0,0"> <PARAM NAME = CODE VALUE = "test.class" > <PARAM NAME = ARCHIVE VALUE = "test.jar" > <PARAM NAME="type" VALUE="application/x-java-applet;jpi-version=1.4"> <PARAM NAME = "scriptable" VALUE = "false" > </object> </body> </html>(文章出处: 中国电脑教育报)