Created
August 13, 2018 09:54
-
-
Save ferrybig/2b599fad57e58c95b851b68a9c1f0267 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Optional.ofNullable(Security.getProvider(provider)) // only on Windows | |
.map(p-> p.getService(type, alg)) // should exist but who knows? | |
.ifPresent(svc-> Security.insertProviderAt( // insert our provider with single SecureRandom service | |
new Provider(name, p.getVersion(), null) {{ //NOSONAR | |
setProperty(String.format("%s.%s", type, alg), svc.getClassName()); | |
}}, 1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment