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

[native-image] Bouncycastle Provider #1693

Closed
luizurias1 opened this issue Sep 19, 2019 · 4 comments
Closed

[native-image] Bouncycastle Provider #1693

luizurias1 opened this issue Sep 19, 2019 · 4 comments
Assignees

Comments

@luizurias1
Copy link

Hi, is it possible to add bouncy castle as a provider to compiled native image?

Even if i add "org.bouncycastle.jce.provider.BouncyCastleProvider" in java.security and use --enable-all-secyrity-services, apparentely it does not cause any effect and continues registering the same providers (I used the flag -H:+TraceSecurityServices).
I have to do something after add the provider in java.security? Or it is impossible to add another provider besides the ones already configured in java.security?

Thanks.

@luizurias1 luizurias1 changed the title Bouncycastle Provider - native image [native image] Bouncycastle Provider Sep 19, 2019
@luizurias1 luizurias1 changed the title [native image] Bouncycastle Provider [native-image] Bouncycastle Provider Sep 19, 2019
@fcurts
Copy link

fcurts commented Sep 19, 2019

This issue contains lots of information on how to use BouncyCastle: #951

I ended up forgoing BouncyCastle because it increased binary size by 15 MB, which was too much for my use case.

@luizurias1
Copy link
Author

I read the issue and tried some approaches. I am using the -J-D argument poiting to a file containing "security.provider.3=org.bouncycastle.jce.provider.BouncyCastleProvider". But when i dont add the BC provider via Security.addProvider i get the error: no such provider BC.

But when i add the BC provider via code, i get the error: Caused by: java.security.NoSuchAlgorithmException: no such algorithm: PKCS12 for provider BC.
It seems that the provider has been registered for native image but the implementations (services) of the provider doesnt.

Any idea?

Thank you!

@cstancu cstancu self-assigned this Sep 21, 2019
@codewhale
Copy link

@luizurias1 , sharing my adventure to enable the BC algorithm in need here:
https://github.com/codewhale/bouncycastle-graalvm-native-image

@cstancu
Copy link
Member

cstancu commented Oct 2, 2020

As I mentioned in a related issue the Bouncy Castle, and all other providers, need to be registered and verified at Native Image build time. See: #2800 (comment).

@cstancu cstancu closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants