与爆炸城堡的SecurityException

时间:2013-05-09 19:25:24

标签: java macos encryption bouncycastle jasypt

我在Mac OS上并在我的Mac上执行软件更新后遇到此问题。

Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC
    at javax.crypto.SunJCE_b.a(DashoA13*..)
    at javax.crypto.SecretKeyFactory.getInstance(DashoA13*..)
    at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:667)
    ... 95 more
Caused by: java.util.jar.JarException: Cannot parse jar:file:/Users/himajumdar/Work/jboss/jboss-5.1.0.GA/server/default/tmp/a00c-b5p2h4-hgi84jo1-1-hgi84qe5-w/csa.ear!/lib/bcprov-jdk15-140.jar
    at javax.crypto.SunJCE_c.a(DashoA13*..)
    at javax.crypto.SunJCE_b.b(DashoA13*..)
    at javax.crypto.SunJCE_b.a(DashoA13*..)
    ... 98 more

我尝试了these个建议

  1. 添加了security.provider.11 = org.bouncycastle.jce.provider.BouncyCastleProvider 到java.security
  2. 在/ Home / jre / lib / ext
  3. 下添加了bcprov-jdk15-140.jar

    但这有助于帮助。我尝试将jdk6更新为jdk7并做同样的事情,并且得到了 unsigned jar

    的轻微不同错误
        at org.jboss.seam.Component.newInstance(Component.java:2132)
        ... 75 more
    Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC
        at javax.crypto.JceSecurity.getInstance(JceSecurity.java:114)
        at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:243)
        at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:667)
        ... 95 more
    Caused by: java.util.jar.JarException: jar:file:/Users/himajumdar/Work/jboss/jboss-5.1.0.GA/server/default/tmp/a00c-4nf5e1-hgiayarg-1-hgiayihg-w/csa.ear!/lib/bcprov-jdk15-140.jar has unsigned entries - csa-ejb-3.45.0.8-SNAPSHOT.jar
        at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:462)
        at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
        at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
    

    我用jdk16-140.jar尝试了这个,但结果相同。有人可以想到任何其他选择来克服这个问题吗?谢谢。

2 个答案:

答案 0 :(得分:9)

  1. 我从当地的jre / jdk ext目录中删除了充气城堡(bcprov-jdk15-140.jar)
  2. 在/jboss/jboss-5.1.0.GA/server/default/lib /
  3. 下复制了bcprov-jdk15-140.jar
  4. 将依赖范围从默认编译更改为提供              充气城堡         bcprov-jdk15         140         提供     
  5. 将“security.provider.11 = org.bouncycastle.jce.provider.BouncyCastleProvider”添加到java.security
  6. This is my Reference

答案 1 :(得分:1)

试试最新版本。可以找到当前最新(1.48)的提供者jar here。你正在尝试的版本(1.40)现在已经很老了。