Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java Security  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 数字签名后的jar包引用问题!
feiggle





发贴: 70
积分: 20
于 2003-04-09 10:51 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
假设有A、B两个jar包,都数字签名了,若A是主applet,A中引用了B包的内容,
现在B包修改后,我有重新对B包进行签名,没有改动其接口,请问A包还能正确执行吗?有做个这个实验的吗?请赐教!




作者 Re:数字签名后的jar包引用问题! [Re:feiggle]
menzy



版主


发贴: 754
积分: 113
于 2003-04-09 16:48 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
应当不成为题,因为两者同样为一个VM引用,而VM验证执行权限的时候是根据包的签名来判断。一个Jar文件引用另一个Jar文件,其间的权限问题交给VM解决,不涉及接口问题。


作者 Re:数字签名后的jar包引用问题! [Re:menzy]
feiggle





发贴: 70
积分: 20
于 2003-04-10 15:48 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
menzy wrote:
应当不成为题,因为两者同样为一个VM引用,而VM验证执行权限的时候是根据包的签名来判断。一个Jar文件引用另一个Jar文件,其间的权限问题交给VM解决,不涉及接口问题。

谢谢!作过试验了,经验总结如下:
情况1:替换B包中的类文件,A包不变,不能执行,错误信息
verifierStream.read!
情况2:B包用另一证书加密或干脆不加密,A包不变
正常运行
结论:对Jar 包进行数字签名只对本Jar包起验证作用,jar包之间的相互关系没有关系
能不能从原理上解释一下?


feiggle edited on 2003-04-10 16:05


作者 Re:数字签名后的jar包引用问题! [Re:feiggle]
menzy



版主


发贴: 754
积分: 113
于 2003-04-11 13:29 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
feiggle wrote:
谢谢!作过试验了,经验总结如下:
情况1:替换B包中的类文件,A包不变,不能执行,错误信息
verifierStream.read!
情况2:B包用另一证书加密或干脆不加密,A包不变
正常运行
结论:对Jar 包进行数字签名只对本Jar包起验证作用,jar包之间的相互关系没有关系
能不能从原理上解释一下?

你在替换B包中的class之后没有重新签名吧?



作者 Re:数字签名后的jar包引用问题! [Re:menzy]
feiggle





发贴: 70
积分: 20
于 2003-04-11 14:52 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
menzy wrote:
你在替换B包中的class之后没有重新签名吧?


若替换B包中的class,会出错,不能运行,错误信息也是verifierstream!
但是,我如果知道B包对其他包所有引用接口,那么,我把签过名的B包
删除之后,再重新生成一个B包(可以用另一个密钥对签名或不签名),完全替换掉原来的B包(签过名的),不改变其他包对B包的引用,那么,程序能运行。不知说清楚了没有,能从原理上解释通吗?




作者 Re:数字签名后的jar包引用问题! [Re:feiggle]
menzy



版主


发贴: 754
积分: 113
于 2003-04-14 15:39 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看样子你没有搞清楚java的代码验证机制。
参考一下《java安全变成指南》和 《Java虚拟机规范》
Consider that jarA is signed by Jack and jarB is signed by Tom
if class A.x want to use B.x, the securitymanager of A.x must declare it want a class signed by Tom.
If Bob modified B.x, then the signarure of Tom is destroyed, and Bob must ask Tom to resign jarB. If Bob signed jarB himself, he must nofity Jack to add the privilege of run B.x by A.x in Jack's source code.
If Jack doesn't define SecurityManager in A.x, A.x will use the default system privilege, which means it can run a class without any signature.




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923