public class SelfSignedCertificateGenerator extends Object
| Constructor and Description |
|---|
SelfSignedCertificateGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAuthorityKeyIdentifier(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder,
KeyPair keyPair) |
protected void |
addBasicConstraints(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder,
org.bouncycastle.asn1.x509.BasicConstraints basicConstraints) |
protected void |
addExtendedKeyUsage(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder) |
protected void |
addKeyUsage(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder) |
protected void |
addSubjectAlternativeNames(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder,
KeyPair keyPair,
@Nullable String applicationUri,
List<String> dnsNames,
List<String> ipAddresses) |
static KeyPair |
generateEcKeyPair(int length)
Generate an EC
KeyPair of bit length length. |
static KeyPair |
generateRsaKeyPair(int length)
Generate an RSA
KeyPair of bit length length. |
X509Certificate |
generateSelfSigned(KeyPair keyPair,
Date notBefore,
Date notAfter,
@Nullable String commonName,
@Nullable String organization,
@Nullable String organizationalUnit,
@Nullable String localityName,
@Nullable String stateName,
@Nullable String countryCode,
@Nullable String applicationUri,
List<String> dnsNames,
List<String> ipAddresses,
String signatureAlgorithm) |
public static KeyPair generateRsaKeyPair(int length) throws NoSuchAlgorithmException
KeyPair of bit length length.length - the length, in bits, of the key to generate.KeyPair of bit length length.NoSuchAlgorithmException - if no Provider supports RSA KeyPair generation.public static KeyPair generateEcKeyPair(int length) throws NoSuchAlgorithmException
KeyPair of bit length length.length - the length, in bits, of the key to generate.KeyPair of bit length length.NoSuchAlgorithmException - if no Provider supports EC KeyPair generation.public X509Certificate generateSelfSigned(KeyPair keyPair, Date notBefore, Date notAfter, @Nullable @Nullable String commonName, @Nullable @Nullable String organization, @Nullable @Nullable String organizationalUnit, @Nullable @Nullable String localityName, @Nullable @Nullable String stateName, @Nullable @Nullable String countryCode, @Nullable @Nullable String applicationUri, List<String> dnsNames, List<String> ipAddresses, String signatureAlgorithm) throws Exception
Exceptionprotected void addSubjectAlternativeNames(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder,
KeyPair keyPair,
@Nullable
@Nullable String applicationUri,
List<String> dnsNames,
List<String> ipAddresses)
throws org.bouncycastle.cert.CertIOException,
NoSuchAlgorithmException
org.bouncycastle.cert.CertIOExceptionNoSuchAlgorithmExceptionprotected void addExtendedKeyUsage(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder)
throws org.bouncycastle.cert.CertIOException
org.bouncycastle.cert.CertIOExceptionprotected void addKeyUsage(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder)
throws org.bouncycastle.cert.CertIOException
org.bouncycastle.cert.CertIOExceptionprotected void addBasicConstraints(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder,
org.bouncycastle.asn1.x509.BasicConstraints basicConstraints)
throws org.bouncycastle.cert.CertIOException
org.bouncycastle.cert.CertIOExceptionprotected void addAuthorityKeyIdentifier(org.bouncycastle.cert.X509v3CertificateBuilder certificateBuilder,
KeyPair keyPair)
throws org.bouncycastle.cert.CertIOException,
NoSuchAlgorithmException
org.bouncycastle.cert.CertIOExceptionNoSuchAlgorithmExceptionCopyright © 2025. All rights reserved.