Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

has unsigned entries - module-info.class for jdk15on-1.61 #477

Closed
looly opened this issue Mar 9, 2019 · 7 comments
Closed

has unsigned entries - module-info.class for jdk15on-1.61 #477

looly opened this issue Mar 9, 2019 · 7 comments

Comments

@looly
Copy link

looly commented Mar 9, 2019

Provider provider = new org.bouncycastle.jce.provider.BouncyCastleProvider();
KeyGenerator.getInstance(algorithm, provider);

When I use this code, throw below error, 1.60 is OK.

java.lang.SecurityException: JCE cannot authenticate the provider BC
	at javax.crypto.JceSecurity.getInstance(JceSecurity.java:114)
	at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:287)
	at cn.hutool.crypto.KeyUtil.getKeyGenerator(KeyUtil.java:518)
	at cn.hutool.crypto.KeyUtil.generateKey(KeyUtil.java:98)
	at cn.hutool.crypto.KeyUtil.generateKey(KeyUtil.java:82)
	at cn.hutool.crypto.KeyUtil.generateKey(KeyUtil.java:123)
	at cn.hutool.crypto.symmetric.SymmetricCrypto.<init>(SymmetricCrypto.java:90)
	at cn.hutool.crypto.symmetric.SymmetricCrypto.<init>(SymmetricCrypto.java:59)
	at cn.hutool.crypto.SmUtil.sm4(SmUtil.java:125)
	at cn.hutool.crypto.test.SmTest.sm4Test(SmTest.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.util.jar.JarException: file:/D:/m2_repo/org/bouncycastle/bcprov-jdk15on/1.61/bcprov-jdk15on-1.61.jar has unsigned entries - module-info.class
	at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:462)
	at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
	at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
	at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
	at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
	at javax.crypto.JceSecurity.getInstance(JceSecurity.java:110)
	... 32 more
@bcgit
Copy link
Collaborator

bcgit commented Mar 9, 2019

What JVM is this with?

@looly
Copy link
Author

looly commented Mar 9, 2019

JDK1.7.0_79

@looly
Copy link
Author

looly commented Mar 9, 2019

test pass on 1.60, but fail on 1.61, maybe module-info.class cause it?

@bcgit
Copy link
Collaborator

bcgit commented Mar 9, 2019

Is that Oracle or OpenJDK?

@looly
Copy link
Author

looly commented Mar 9, 2019

Oracle

@bcgit
Copy link
Collaborator

bcgit commented Mar 12, 2019

Okay. Try what's in https://www.bouncycastle.org/betas now. Let me know how it goes.

@looly
Copy link
Author

looly commented Mar 12, 2019

Thank you, "bcprov-jdk15on-162b07.jar" is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant