gpt4 book ai didi

algorithm - BouncyCaSTLe 和算法错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:42:17 26 4
gpt4 key购买 nike

我在 Windows 上使用 BouncyCaSTLe 和 PBEWITHSHAAND256BITAES-CBC-BC 算法时遇到错误

我的代码:

Security.addProvider(new BouncyCastleProvider());
SecretKeyFactory localSecretKeyFactory = SecretKeyFactory.getInstance("PBEWITHSHAAND256BITAES-CBC-BC");

然后给我错误:

java.security.NoSuchAlgorithmException: PBEWITHSHAAND256BITAES-CBC-BC SecretKeyFactory not available
at javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:122)
at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:160)
at pl.edu.tirex.server.KeyFactory.<init>(KeyFactory.java:28)
at pl.edu.tirex.server.Main.main(Main.java:29)

最佳答案

您正在附加新的提供者。在第一行使用此代码:

 Security.insertProviderAt(new BouncyCastleProvider(), 1);

关于algorithm - BouncyCaSTLe 和算法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32140019/

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