Use a better name to indicate Windows

This commit is contained in:
Tim203 2021-04-01 00:57:47 +02:00
parent 5c12dc8e15
commit a5a849c059
No known key found for this signature in database
GPG key ID: 064EE9F5BF7C3EE8

View file

@ -59,7 +59,7 @@ public final class AesKeyProducer implements KeyProducer {
private SecureRandom getSecureRandom() throws NoSuchAlgorithmException {
// use Windows-PRNG for windows (default impl is SHA1PRNG)
// default impl for unix-like systems is NativePRNG.
if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win")) {
if (System.getProperty("os.name").startsWith("Windows")) {
return SecureRandom.getInstance("Windows-PRNG");
} else {
return new SecureRandom();