gpt4 book ai didi

java - OpenJDK 1.8 set/dev/urandom 什么时候生效?

转载 作者:行者123 更新时间:2023-12-05 04:04:24 31 4
gpt4 key购买 nike

我们知道有两个选项可以让 SecureRandom 使用 /dev/urandom 而不是 /dev/random:

  1. 更改JRE_PATH/lib/security/java.security 文件
  2. 设置jvm属性-Djava.security.egd

但是两者都设置时哪个生效呢?

最佳答案

<java_dir>/jre/lib/security/java.security 中的文档明确地说:

The entropy gathering device can also be specified with the System property "java.security.egd". For example:

% java -Djava.security.egd=file:/dev/random MainClass

Specifying this System property will override the "securerandom.source" Security property.

因此系统属性在设置时将始终具有优先权。

关于java - OpenJDK 1.8 set/dev/urandom 什么时候生效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52567004/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com