Class CertificateParameters.CertificateParametersBuilder
java.lang.Object
org.springframework.credhub.support.certificate.CertificateParameters.CertificateParametersBuilder
- Enclosing class:
- CertificateParameters
A builder that provides a fluent API for constructing
CertificateParameters.CertificateParametersBuilder
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalternateNames
(String... alternativeNames) Set the Alternative Names (SAN) field to be used for the generated certificate.build()
Create aCertificateParameters
from the provided values.certificateAuthority
(boolean certificateAuthority) Set the value of the flag that indicates whether the generated certificate is a certificate authority.certificateAuthorityCredential
(String certificateAuthorityCredential) Set the name of a certificate authority credential in CredHub to sign the generated certificate with.certificateAuthorityCredential
(CredentialName certificateAuthorityCredential) Set the name of a certificate authority credential in CredHub to sign the generated certificate with.commonName
(String commonName) Set the Common Name (CN) field to be used for the generated certificate.Set the Country (C) field to be used for the generated certificate.duration
(int duration) Set the duration in days that the generated certificate should be valid.extendedKeyUsage
(ExtendedKeyUsage... extendedKeyUsage) Set the value of the extended key usage extensions for the generated certificate.Set the length of the key for the generated certificate.Set the value of the key usage extensions for the generated certificate.Set the Locality (L) field to be used for the generated certificate.organization
(String organization) Set the Organization (O) field to be used for the generated certificate.organizationUnit
(String organizationUnit) Set the Organization Unit (OU) field to be used for the generated certificate.selfSign
(boolean selfSign) Set the value of the flag that indicates whether the generated certificate should be self-signed.Set the State (S) field to be used for the generated certificate.
-
Constructor Details
-
CertificateParametersBuilder
public CertificateParametersBuilder()
-
-
Method Details
-
keyLength
Set the length of the key for the generated certificate.- Parameters:
keyLength
- the parameter value; must not be null- Returns:
- the builder
-
commonName
Set the Common Name (CN) field to be used for the generated certificate.- Parameters:
commonName
- the parameter value; must not be null- Returns:
- the builder
-
alternateNames
public CertificateParameters.CertificateParametersBuilder alternateNames(String... alternativeNames) Set the Alternative Names (SAN) field to be used for the generated certificate.- Parameters:
alternativeNames
- the parameter value; must not be null- Returns:
- the builder
-
organization
Set the Organization (O) field to be used for the generated certificate.- Parameters:
organization
- the parameter value; must not be null- Returns:
- the builder
-
organizationUnit
Set the Organization Unit (OU) field to be used for the generated certificate.- Parameters:
organizationUnit
- the parameter value; must not be null- Returns:
- the builder
-
locality
Set the Locality (L) field to be used for the generated certificate.- Parameters:
locality
- the parameter value; must not be null- Returns:
- the builder
-
state
Set the State (S) field to be used for the generated certificate.- Parameters:
state
- the parameter value; must not be null- Returns:
- the builder
-
country
Set the Country (C) field to be used for the generated certificate.- Parameters:
country
- the parameter value; must not be null- Returns:
- the builder
-
duration
Set the duration in days that the generated certificate should be valid.- Parameters:
duration
- the parameter value- Returns:
- the builder
-
certificateAuthorityCredential
public CertificateParameters.CertificateParametersBuilder certificateAuthorityCredential(String certificateAuthorityCredential) Set the name of a certificate authority credential in CredHub to sign the generated certificate with.- Parameters:
certificateAuthorityCredential
- the parameter value; must not be null- Returns:
- the builder
-
certificateAuthorityCredential
public CertificateParameters.CertificateParametersBuilder certificateAuthorityCredential(CredentialName certificateAuthorityCredential) Set the name of a certificate authority credential in CredHub to sign the generated certificate with.- Parameters:
certificateAuthorityCredential
- the parameter value; must not be null- Returns:
- the builder
-
certificateAuthority
public CertificateParameters.CertificateParametersBuilder certificateAuthority(boolean certificateAuthority) Set the value of the flag that indicates whether the generated certificate is a certificate authority.- Parameters:
certificateAuthority
- the parameter value- Returns:
- the builder
-
selfSign
Set the value of the flag that indicates whether the generated certificate should be self-signed.- Parameters:
selfSign
- the parameter value- Returns:
- the builder
-
keyUsage
Set the value of the key usage extensions for the generated certificate.- Parameters:
keyUsage
- one or more parameter values- Returns:
- the builder
-
extendedKeyUsage
public CertificateParameters.CertificateParametersBuilder extendedKeyUsage(ExtendedKeyUsage... extendedKeyUsage) Set the value of the extended key usage extensions for the generated certificate.- Parameters:
extendedKeyUsage
- one or more parameter values- Returns:
- the builder
-
build
Create aCertificateParameters
from the provided values.- Returns:
- the created
CertificateParameters
-