diff --git a/core/deployment/src/main/java/io/quarkus/deployment/SecureRandomProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/SecureRandomProcessor.java new file mode 100644 index 0000000000000..23914a030144b --- /dev/null +++ b/core/deployment/src/main/java/io/quarkus/deployment/SecureRandomProcessor.java @@ -0,0 +1,15 @@ +package io.quarkus.deployment; + +import io.quarkus.deployment.annotations.BuildProducer; +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveMethodBuildItem; + +public class SecureRandomProcessor { + + @BuildStep + void registerReflectiveMethods(BuildProducer reflectiveMethods) { + // Called reflectively through java.security.SecureRandom.SecureRandom() + reflectiveMethods.produce(new ReflectiveMethodBuildItem("sun.security.provider.NativePRNG", "", java.security.SecureRandomParameters.class)); + } + +}