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 00000000000000..7eb9296a024469 --- /dev/null +++ b/core/deployment/src/main/java/io/quarkus/deployment/SecureRandomProcessor.java @@ -0,0 +1,16 @@ +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)); + } + +}