siemens / cmp-ra-component

A CMP Registration Authority (RA)
Apache License 2.0
2 stars 5 forks source link

Change initialization of BouncyCatsle Provider #59

Closed luje closed 11 months ago

luje commented 11 months ago

Description

Bouncy Castle Provider was initialized as a static variable. This would mean that if another library or application already initialized the provider, it would be initialized twice.

Related Issue

No open issue.

Motivation and Context

We are using the CMP-ra-component in a project that does GraalVM native compilation. We need the bouncy castle security provider instance to be initialized at build time so that the native-image build process works. Referencing the instance created by the CMP-ra-component is not possible because it pulls other classes into the build process which should be initialized at runtime. More information at: https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/JCASecurityServices/ see SecureRandom section.

How Has This Been Tested?

Test suite runs correctly

Screenshots

No screenshots

ralienpp commented 11 months ago

@luje, thank you for your contribution!