?? java applet 簽名和認證 ---大致過程和我的問題.txt
字號:
作者:netkey
日期:2001-5-25 11:44:10
在java中的 applet 的認證和簽名 確實麻煩。。
java.sun.com 的tutorial 上有用apple 在本地寫一個文件的例子:
http://java.sun.com/docs/books/tutorial/security1.2/tour1/
但只能用AppletViewer 可以看:
appletviewer http://java.sun.com/docs/books/tutorial/security1.2/tour1/example-1dot2/WriteFile.html
又在[阿費]的幫助下找到可以用ie or Nescape 查看你的applet 的例子:
http://www.intelligentsearch.org/namesearch_from_java.htm#_Toc490550108
大致過程如下::
服務器端:
1。 Compile the java classes --寫applet并編譯。
javac *.class
2. Place the class files in a JAR file --打包:
jar cvf yourjarname.jar yourdir/*.class
1). Create a Keystore and Keys for signing the JAR file
keytool –genkey –keystore ist.keystore –alias IST
2). Sign the JAR file --對jar 簽名
jarsigner –keystore ist.keystore ist.jar IST
3). Create the Public Key Certificate --創建公鑰
keytool –export –keystore ist.keystore –alias IST –file IstPubKey.cert
客戶端:
1。Import the Public Key Certificate --導入公鑰
keytool –import –alias IST –file IstPubKey.cert –keystore client.store
2。Modifing a policy file --修改 policy文件
3。 Run the applet --運行applet
!!! 這還只能用Applet viewer 查看你的applet
用ie訪問:
First, the <APPLET> tag will not be able to activate the Java Plug-in for use in IE. This tag should be substituted by the <OBJECT> tag
---由于IE 的java Plug-in 不能被<APPLET>標簽激活。你還要將他換成<OBJECT>標簽。
these changes to the HTML file can also be done with the help of HTMLConverter. You can go to download this software from http://java.sun.com/products/plugin/index.html.
---- 這樣你還要去下一個HTMLConverter
---- 將經過轉換的html 和 class 文件copy 到你的服務器上。
-- 好了。終于可以享受一下成果了。
用ie 訪問:http://yourserver: youreport/WriteFile.html
還不行??
--IE 還要下載Plug-in 才能執行,
在1小時加26分46秒后:
kao ,終于在本地寫了一個文件。
////////////////////////////////////////////
感謝:
【wmlf】 和 【阿費】提供的資料和幫助
////////////////////////////////////////////
我的問題:
1。如果我寫的applet,放在網上,
他還必需下載或自己修改java.security and java.policy
然后放到 :
<java home>/lib/security 下(如果安裝了jdk)
<use dir>/.java.policy (沒有 jdk)
那不是太麻煩了????
誰還會用你的applet ????
2。是不是我對applet 認證理解不對,,本來applet的認證沒這樣繁??
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -