public class CertBuilder
extends java.lang.Object
Creates Certificates to use in PEM format always a private/public key pair for use in SAMl and JWT configurations Use:
new CertBuilder()
.fqdn("Peter Pan")
.daysValid(365)
.key(KeyType.EC)
.build();
Modifier and Type | Class and Description |
---|---|
static class |
CertBuilder.KeyType
Allowed key types
|
Constructor and Description |
---|
CertBuilder() |
Modifier and Type | Method and Description |
---|---|
CertBuilder |
daysValid(int days)
How long should the cert be valid, minimum 1 day
|
CertBuilder |
fqdn(java.lang.String name)
Set the fqdn
|
PemHolder |
generate()
Generates public/private key pair based on keyType, fqdn and algorithm
|
CertBuilder |
keyType(CertBuilder.KeyType type)
Defines the keyType to use for generation
|
public CertBuilder daysValid(int days)
How long should the cert be valid, minimum 1 day
days
- public CertBuilder fqdn(java.lang.String name)
Set the fqdn
name
- public PemHolder generate() throws java.security.NoSuchAlgorithmException, org.bouncycastle.operator.OperatorCreationException, java.security.cert.CertificateException, java.security.InvalidKeyException, java.security.NoSuchProviderException, java.security.SignatureException
Generates public/private key pair based on keyType, fqdn and algorithm
java.security.NoSuchAlgorithmException
org.bouncycastle.operator.OperatorCreationException
java.security.cert.CertificateException
java.security.SignatureException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.lang.Exception
public CertBuilder keyType(CertBuilder.KeyType type)
Defines the keyType to use for generation
type
- RSA or EC