简体   繁体   English

签名者信息不匹配

[英]Signer information does not match

I'm receving the following error on log file. 我在日志文件中收到以下错误。

(java.lang.SecurityException: class "com.adventnet.snmp.snmp2.SecurityModelTable"'s signer information does not match signer information of other classes in the same package thrown (java.lang.SecurityException:类“com.adventnet.snmp.snmp2.SecurityModelTable”的签名者信息与抛出的同一个包中其他类的签名者信息不匹配

The thing is when I run below command, it says jar verified. 事情就是当我在命令下运行时,它说jar验证了。

/usr/jdk/instances/jdk1.5.0/bin/jarsigner -verify -verbose Jarfile.jar

If the jar file is verified then how can this problem occur ? 如果jar文件已经过验证,那么这个问题怎么办?

check pom dependency tree for same packages of different versions . 检查不同版本的相同包的 pom依赖关系树。

I had this issue with itext-2.1.7 including old bouncycastle's bcpkix that was included in later version elsewhere. 我有这个问题与itext-2.1.7包括旧bouncycastle's bcpkix ,其他version包含在其他version

Use this pattern : 使用此pattern

<dependency>
  package X
  <exclusions>
    <exclusion>
      old package Y
    </exclusion>
  </exclusions>
</dependency>

<dependency>
  latest package Y
</dependency>

Update: To check the dependency tree details of package_Y you can use mvn dependency:tree -Dverbose -Dincludes=package_Y . 更新:要检查package_Y的依赖关系树详细信息,可以使用mvn dependency:tree -Dverbose -Dincludes=package_Y For more info check maven documentation on resolving dependency tree problems. 有关更多信息,请查看有关解决依赖关系树问题的maven文档 Also the Eclipse have quite nice dependency tree viewer. Eclipse也有很好的依赖树查看器。

It means that you have two or more classes in the same package with different signature data. 这意味着您在同一个包中有两个或更多类具有不同的签名数据。 Usually that means the classes come from different JARs, one of which is signed and the other is unsigned. 通常这意味着类来自不同的JAR,其中一个是签名的,另一个是未签名的。

I encountered this exception while running a Scala/Spark project in Eclipse (Mars) on Windows and it prevented me from debugging and running the project in the IDE. 我在Windows上运行Eclipse(Mars)中的Scala / Spark项目时遇到此异常,这使我无法在IDE中调试和运行项目。 The project used a Maven pom.xml file. 该项目使用了Maven pom.xml文件。 It took a while to resolve, so I'm posting detailed steps here to help others: 需要一段时间才能解决,因此我在此处发布详细步骤以帮助其他人:

  1. Go to the folder where your project pom.xml file is 转到项目pom.xml文件所在的文件夹
  2. Run the command: mvn dependency:tree -Dverbose >Depends.Txt Make sure you don't have a Depends.Txt or it will be overwritten! 运行命令:mvn dependency:tree -Dverbose> Depends.Txt确保没有Depends.Txt或它将被覆盖!
  3. Search in the Depends.Txt file for the unsigned class that the Eclipse IDE is complaining about. 在Depends.Txt文件中搜索Eclipse IDE抱怨的unsigned类。 In my case, it was javax.servlet. 就我而言,它是javax.servlet。
  4. You may find it in a section that looks like this: 您可以在看起来像这样的部分中找到它:

    +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.0:provided + - org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.0:提供

    +- javax.servlet:servlet-api:jar:2.5:provided + - javax.servlet:servlet-api:jar:2.5:提供

  5. The Maven group ID that you want to exclude the duplicate class from in the above is: hadoop-mapreduce-client-core 要在上面排除重复类的Maven组ID是:hadoop-mapreduce-client-core

  6. Add an exclusions section listing the groupid of the exclusion in the pom.xml after the offending package. 在违规包之后添加一个排除部分,列出pom.xml中排除的groupid。 In my case, this was the groupid javax.servlet. 在我的例子中,这是groupid javax.servlet。

  7. Note that you can't resolve this issue by reordering the Java build path as some have posted for a similar problem. 请注意,您无法通过重新排序Java构建路径来解决此问题,因为有些人已针对类似问题发布了这些路径。

java.lang.SecurityException: class “org.bouncycastle.asn1.ASN1ObjectIdentifier”'s signer information does not match signer information of other classes in the same package java.lang.SecurityException:类“org.bouncycastle.asn1.ASN1ObjectIdentifier”的签名者信息与同一包中其他类的签名者信息不匹配

Ans: I was also facing same exception when I was trying to make PDF password protected. Ans:当我试图使PDF密码受到保护时,我也遇到了同样的异常。

I added below jars to resolve the same. 我在下面的罐子里加了解决方法。

◾itextpdf-5.2.1.jar ◾bcmail-jdk16-1.46.jar ◾bcprov-jdk16-1.46.jar ◾bctsp-jdk16-1.46.jar ◾itextpdf-5.2.1.jar◾bcmail-jdk16-1.46.jar◾bcprov-jdk16-1.46.jar◾bctsp-jdk16-1.46.jar

In my program, I have loaded two version of the same packages. 在我的程序中,我已经加载了相同包的两个版本。 One is boprov-jdk15-140.jar , the other is bcprov-jdk15-151.jar . 一个是boprov-jdk15-140.jar ,另一个是bcprov-jdk15-151.jar The two are conflicted. 这两者是矛盾的。

In the JAR package's MANIFEST.MF file, it has the following digest: 在JAR包的MANIFEST.MF文件中,它具有以下摘要:

Name: org/bouncycastle/crypto/digests/SM3Digest.class
SHA1-Digest: xxxxxxxx

The two JAR file has different SHA1-Digest info. 两个JAR文件具有不同的SHA1-Digest信息。

In my case I had: 在我的情况下,我有:

Caused by: java.lang.SecurityException: class "org.bouncycastle.util.Strings"'s signer information does not match signer information of other classes in the same package

It was a project with a lot of dependencies and the mvn dependency:tree information did not really helped me. 这是一个有很多依赖项和mvn依赖项的项目:树信息并没有真正帮助我。

Here is how I solved my issue: 以下是我解决问题的方法:

  • I did a search "Find in files" using notepad++ on all the M2_REPO 我在所有M2_REPO上使用notepad ++搜索了“在文件中查找”
  • I found a project which redefined "Strings" class in a package exactly identical to "org.bouncycastle.util.Strings" which should originate from the "org.bouncycastle:bcprov-jdk15on" dependency. 我找到了一个项目,它在一个与“org.bouncycastle.util.Strings”完全相同的包中重新定义了“Strings”类,它应该来自“org.bouncycastle:bcprov-jdk15on”依赖项。
  • Once found, I moved all of these problematic classes in a new package and updated this project version. 一旦找到,我将所有这些有问题的类移到一个新包中并更新了这个项目版本。
  • Finally I updated the pom of the project which caused me trouble in the first place to use my dependency that uses the new package name. 最后,我更新了项目的pom,这首先使我遇到麻烦,使用我使用新软件包名称的依赖项。

Problem solved. 问题解决了。

I encountered this issue in a Spring boot application. 我在Spring启动应用程序中遇到了这个问题。 My issue was that I had Junit in the build path which has Org.hamcrest.Matchers.* and Hamcrest which was resident in library of Spring framework in my pom.xml in eclipse repository. 我的问题是我在构建路径中有Junit,其中包含Org.hamcrest.Matchers。*和Hamcrest,它位于eclipse存储库中我的pom.xml中的Spring框架库中。 So what I did was remove Junit from my build path. 所以我所做的就是从构建路径中删除Junit。 Included Junit only in my pom.xml. 仅在我的pom.xml中包含Junit。 So my application depended on Maven for Junit and the *Matchers. 所以我的应用依赖于Maven for Junit和* Matchers。 So somehow you have two jars for one need. 所以不知怎的,你有一个需要的两个罐子。 Maybe as a library and as configuration file. 也许作为库和配置文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 签名者信息与同一个其他类的签名者信息不匹配 package - Signer information does not match signer information of other classes in the same package JMockIt安全异常签名者信息不匹配 - JMockIt security exception signer information does not match Java SecurityException:签名者信息不匹配 - Java SecurityException: signer information does not match 启动程序后CGLIB错误(签名者信息与同一软件包中其他类的签名者信息不匹配) - CGLIB error after launching program (signer information does not match signer information of other classes in the same package) 类“ org.bouncycastle.cms.CMSProcessable”的签名者信息与其他类的签名者信息不匹配 - class “org.bouncycastle.cms.CMSProcessable”'s signer information does not match signer information of other classes java.lang.SecurityException: signer information does not match other classes in the same package in PowerMock 中的签名者信息与其他类的签名者信息不匹配 - java.lang.SecurityException: signer information does not match signer information of other classes in the same package in PowerMock java.lang.SecurityException:签名者信息与同一包中其他类的签名者信息不匹配 - java.lang.SecurityException: signer information does not match signer information of other classes in the same package JFace签名者信息与同一package中其他类的签名者信息不匹配 - JFace signer information does not match signer information of other classes in the same package Hamcrest Matcher 签名者信息与同一包中其他类的签名者信息不匹配 - Hamcrest Matcher signer information does not match signer information of other classes in the same package 类“ SynchronousHelper”的签名者信息与同一包中其他类的签名者信息不匹配 - class “SynchronousHelper”'s signer information does not match signer information of other classes in the same package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM