EC.generateKeyPair() 在 Bouncy Castle FIPS 库中缺失
EC.generateKeyPair() missing in Bouncy Castle FIPS library
The Bouncy Castle FIPS Java API in 100 Examples建议多次使用EC.generateKeyPair()
。假设此引用 org.bouncycastle.crypto.general.EC
(因为这是唯一一个名称为 EC
的 class),我找不到方法 generateKeyPair()
。错误在哪里以及如何生成相应的密钥对?
来自提供的 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.
The Bouncy Castle FIPS Java API in 100 Examples建议多次使用EC.generateKeyPair()
。假设此引用 org.bouncycastle.crypto.general.EC
(因为这是唯一一个名称为 EC
的 class),我找不到方法 generateKeyPair()
。错误在哪里以及如何生成相应的密钥对?
来自提供的 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.