您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

是否可以在Java Manifest文件中拥有SHA1-Digest而无需实际使用密钥

是否可以在Java Manifest文件中拥有SHA1-Digest而无需实际使用密钥

这应该是可能的。MANIFEST.MF文件包含各个类文件的Base64编码的SHA-1。

从您的文档中:

In the manifest file, the SHA digest value for each source file is the
digest (hash) of the binary data in the source file. In the .SF file,
on the other hand, the digest value for a given source file is the
hash of the three lines in the manifest file for the source file.

因此,遍历所有类文件,计算SHA-1,将其格式显示在MANIFEST.MF中,然后对其进行哈希处理并按其格式显示在SF文件中。

计算不涉及任何键。

示例:考虑“ jce1_2_2.jar”(或任何您已经正确签名的)。这包含

表格的MANIFEST.MF条目

Name: javax/crypto/KeyAgreement.class

SHA1-Digest: c2p0JimzpV0dG+NChGLl5cI7MuY=

它们是“ KeyAgreement.class”的Base64(SHA1-1)(路径无关)。注意第三个空行。行尾为CRLF(Windows)。

Meta-INF / 4JCEJARS.SF条目

Name: javax/crypto/KeyAgreement.class

SHA1-Digest: whGBXE+AvYO6wAoVCdnocOPIrsE=

这不是文件的哈希值,而是上面三行的哈希值。

java 2022/1/1 18:26:36 有485人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶