gpt4 book ai didi

java - Tomcat 7 : SecureRandomAlgorithm

转载 作者:行者123 更新时间:2023-11-28 23:38:08 25 4
gpt4 key购买 nike

在 Tomcat 7.0.30 代码中:

org.apache.catalina.session.ManagerBase 类:代码片段

/**
* The name of the algorithm to use to create instances of
* {@link java.security.SecureRandom} which are used to generate session IDs.
* If no algorithm is specified, SHA1PRNG is used. To use the platform
* default (which may be SHA1PRNG), specify the empty string. If an invalid
* algorithm and/or provider is specified the SecureRandom instances will be
* created using the defaults. If that fails, the SecureRandom instances
* will be created using platform defaults.
*/
protected String secureRandomAlgorithm = "SHA1PRNG";

/**
* Return the secure random number generator algorithm name.
*/
public String getSecureRandomAlgorithm() {
return secureRandomAlgorithm;
}


/**
* Set the secure random number generator algorithm name.
*
* @param secureRandomAlgorithm The new secure random number generator
* algorithm name
*/
public void setSecureRandomAlgorithm(String secureRandomAlgorithm) {
this.secureRandomAlgorithm = secureRandomAlgorithm;
}

这里默认使用SHA1PRNG。我可以在这里使用所有可能的算法。是否有可用的列表。

我看过link . SecureRandomAlgorithm 部分仅给出了SHA1PRNG

最佳答案

似乎只实现了 SHA1PRNG。也许尝试 Security.getAlgorithms(String serviceName) 看看,是否还有其他的?看这里:http://docs.oracle.com/javase/7/docs/api/java/security/Security.html#getAlgorithms%28java.lang.String%29在这里:http://docs.oracle.com/javase/7/docs/api/java/security/SecureRandom.html#SecureRandom%28%29

关于java - Tomcat 7 : SecureRandomAlgorithm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22761401/

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