在 java 中生成 X509v(1/3) 证书(充气城堡)

Generating X509v(1/3) certificates in java (bouncy castle)

看完a number of questions on generating X509 certificates using bouncy castle I found that the X509V1CertificateGenerator class documented here is deprecated and tried to use the current version, X509v1CertificateBuilder, as suggested here. The problem is that there doesn't seem to be a package cert as mentioned in the documentation。我正在使用 maven 检索充气城堡:

<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcprov-jdk15on</artifactId>
    <version>1.53</version>
</dependency>

X509v1CertificateBuilder 位于哪个包中?

充气城堡还需要:bcpkix-jdk15on

<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcpkix-jdk15on</artifactId>
    <version>1.47</version>
</dependency>