简体   繁体   English

Bouncy Castle FIPS 库中缺少 EC.generateKeyPair()

[英]EC.generateKeyPair() missing in Bouncy Castle FIPS library

The Bouncy Castle FIPS Java API in 100 Examples suggests multiple times the use of EC.generateKeyPair() . Bouncy Castle FIPS Java API 在 100 个示例中建议多次使用EC.generateKeyPair() Assuming this references org.bouncycastle.crypto.general.EC (as this is the only class with name EC ) I'm not able to find a method generateKeyPair() .假设这个引用org.bouncycastle.crypto.general.EC (因为这是唯一一个名为EC的 class )我找不到方法generateKeyPair() Where's the error and how to generate an according key pair?错误在哪里以及如何生成相应的密钥对?

From the PDF provided ( https://www.bouncycastle.org/fips-java/BCFipsIn100.pdf ):从 PDF 提供( https://www.bouncycastle.org/fips-java/BCFipsIn100.pdf ):

Example 31 – Key Pair Generation示例 31 – 密钥对生成

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.该示例将产生曲线 P-384 上的密钥对。 Other default curves available include P-224, P-256, and P-521.其他可用的默认曲线包括 P-224、P-256 和 P-521。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM