The Bouncy Castle FIPS Java API in 100 Examples建议多次使用 EC.generateKeyPair()
。假设此引用org.bouncycaSTLe.crypto.general.EC
(因为这是唯一名为EC
的类),我无法找到方法generateKeyPair ()
。错误在哪里以及如何生成相应的 key 对?
最佳答案
来自提供的 PDF ( https://www.bouncycastle.org/fips-java/BCFipsIn100.pdf ):
Example 31 – Key Pair Generation
public static KeyPair generateKeyPair() throws GeneralSecurityException { KeyPairGenerator keyPair = KeyPairGenerator.getInstance("EC", "BCFIPS"); keyPair.initialize(384); return keyPair.generateKeyPair(); }
The example will result in a key pair on the curve P-384. Other default curves available include P-224, P-256, and P-521.
关于java - Bouncy CaSTLe FIPS 库中缺少 EC.generateKeyPair(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58691471/