gpt4 book ai didi

java - Bouncy CaSTLe 无法在 Linux 机器上运行

转载 作者:可可西里 更新时间:2023-11-01 10:03:01 28 4
gpt4 key购买 nike

我为 fips 投诉签名生成和验证实现了 boucnyCaSTLe,这在 Windows 环境中运行良好,但在 Linux 环境中,代码卡在 key 对生成上。以下是我编写的代码:

public static KeyPair generateKeyPair() throws GeneralSecurityException
{
KeyPairGenerator keyPair = KeyPairGenerator.getInstance("RSA", "BCFIPS");
keyPair.initialize(new RSAKeyGenParameterSpec(3072, RSAKeyGenParameterSpec.F4));
return keyPair.generateKeyPair();
}

Bouncy Castle

最佳答案

首先检查 rngd.service(硬件 RNG 熵收集器守护进程)是否正在您的系统上运行。如果您使用的是虚拟机,那么它不会运行,要修复它,请使用以下链接:

http://wiki.networksecuritytoolkit.org/index.php/HowTo_Fix_The_rngd.service

第二次使用命令检查您的系统是否有足够的熵:

cat /proc/sys/kernel/random/entropy_avail

如果您系统的熵不够,则增加它。您可以使用以下链接:

https://redhatlinux.guru/index.php/2016/04/03/increase-system-entropy-on-rhel-centos-6-and-7/

同时在您的系统上安装 Haveged 以生成人工熵。要安装 Haveged,您可以使用以下链接:

https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged

关于java - Bouncy CaSTLe 无法在 Linux 机器上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47795876/

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