Class CertificateSpec.Builder
- java.lang.Object
-
- com.marcnuri.yakc.model.io.certmanager.v1alpha3.CertificateSpec.Builder
-
- Enclosing class:
- CertificateSpec
public static class CertificateSpec.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateSpec.Builder
addToDnsNames(java.lang.String addToDnsNames)
CertificateSpec.Builder
addToEmailSANs(java.lang.String addToEmailSANs)
CertificateSpec.Builder
addToIpAddresses(java.lang.String addToIpAddresses)
CertificateSpec.Builder
addToUriSANs(java.lang.String addToUriSANs)
CertificateSpec.Builder
addToUsages(java.lang.String addToUsages)
CertificateSpec
build()
CertificateSpec.Builder
clearDnsNames()
CertificateSpec.Builder
clearEmailSANs()
CertificateSpec.Builder
clearIpAddresses()
CertificateSpec.Builder
clearUriSANs()
CertificateSpec.Builder
clearUsages()
CertificateSpec.Builder
commonName(java.lang.String commonName)
CommonName is a common name to be used on the Certificate.CertificateSpec.Builder
dnsNames(java.util.Collection<? extends java.lang.String> dnsNames)
CertificateSpec.Builder
duration(java.lang.String duration)
The requested 'duration' (i.e.CertificateSpec.Builder
emailSANs(java.util.Collection<? extends java.lang.String> emailSANs)
CertificateSpec.Builder
encodeUsagesInRequest(java.lang.Boolean encodeUsagesInRequest)
EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequestCertificateSpec.Builder
ipAddresses(java.util.Collection<? extends java.lang.String> ipAddresses)
CertificateSpec.Builder
isCA(java.lang.Boolean isCA)
IsCA will mark this Certificate as valid for certificate signing.CertificateSpec.Builder
issuerRef(@NonNull CertificateSpecIssuerRef issuerRef)
CertificateSpec.Builder
keyAlgorithm(java.lang.String keyAlgorithm)
KeyAlgorithm is the private key algorithm of the corresponding private key for this certificate.CertificateSpec.Builder
keyEncoding(java.lang.String keyEncoding)
KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private key to be encoded in.CertificateSpec.Builder
keySize(java.lang.Number keySize)
KeySize is the key bit size of the corresponding private key for this certificate.CertificateSpec.Builder
keystores(CertificateSpecKeystores keystores)
CertificateSpec.Builder
privateKey(CertificateSpecPrivateKey privateKey)
CertificateSpec.Builder
renewBefore(java.lang.String renewBefore)
The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate.CertificateSpec.Builder
secretName(@NonNull java.lang.String secretName)
SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource.CertificateSpec.Builder
subject(CertificateSpecSubject subject)
java.lang.String
toString()
CertificateSpec.Builder
uriSANs(java.util.Collection<? extends java.lang.String> uriSANs)
CertificateSpec.Builder
usages(java.util.Collection<? extends java.lang.String> usages)
-
-
-
Method Detail
-
commonName
public CertificateSpec.Builder commonName(java.lang.String commonName)
CommonName is a common name to be used on the Certificate. The CommonName should have a length of 64 characters or fewer to avoid generating invalid CSRs. This value is ignored by TLS clients when any subject alt name is set. This is x509 behaviour: https://tools.ietf.org/html/rfc6125#section-6.4.4- Returns:
this
.
-
addToDnsNames
public CertificateSpec.Builder addToDnsNames(java.lang.String addToDnsNames)
-
dnsNames
public CertificateSpec.Builder dnsNames(java.util.Collection<? extends java.lang.String> dnsNames)
-
clearDnsNames
public CertificateSpec.Builder clearDnsNames()
-
duration
public CertificateSpec.Builder duration(java.lang.String duration)
The requested 'duration' (i.e. lifetime) of the Certificate. This option may be ignored/overridden by some issuer types. If overridden and `renewBefore` is greater than the actual certificate duration, the certificate will be automatically renewed 2/3rds of the way through the certificate's duration.- Returns:
this
.
-
addToEmailSANs
public CertificateSpec.Builder addToEmailSANs(java.lang.String addToEmailSANs)
-
emailSANs
public CertificateSpec.Builder emailSANs(java.util.Collection<? extends java.lang.String> emailSANs)
-
clearEmailSANs
public CertificateSpec.Builder clearEmailSANs()
-
encodeUsagesInRequest
public CertificateSpec.Builder encodeUsagesInRequest(java.lang.Boolean encodeUsagesInRequest)
EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest- Returns:
this
.
-
addToIpAddresses
public CertificateSpec.Builder addToIpAddresses(java.lang.String addToIpAddresses)
-
ipAddresses
public CertificateSpec.Builder ipAddresses(java.util.Collection<? extends java.lang.String> ipAddresses)
-
clearIpAddresses
public CertificateSpec.Builder clearIpAddresses()
-
isCA
public CertificateSpec.Builder isCA(java.lang.Boolean isCA)
IsCA will mark this Certificate as valid for certificate signing. This will automatically add the `cert sign` usage to the list of `usages`.- Returns:
this
.
-
issuerRef
public CertificateSpec.Builder issuerRef(@NonNull @NonNull CertificateSpecIssuerRef issuerRef)
-
keyAlgorithm
public CertificateSpec.Builder keyAlgorithm(java.lang.String keyAlgorithm)
KeyAlgorithm is the private key algorithm of the corresponding private key for this certificate. If provided, allowed values are either "rsa" or "ecdsa" If `keyAlgorithm` is specified and `keySize` is not provided, key size of 256 will be used for "ecdsa" key algorithm and key size of 2048 will be used for "rsa" key algorithm.- Returns:
this
.
-
keyEncoding
public CertificateSpec.Builder keyEncoding(java.lang.String keyEncoding)
KeyEncoding is the private key cryptography standards (PKCS) for this certificate's private key to be encoded in. If provided, allowed values are "pkcs1" and "pkcs8" standing for PKCS#1 and PKCS#8, respectively. If KeyEncoding is not specified, then PKCS#1 will be used by default.- Returns:
this
.
-
keySize
public CertificateSpec.Builder keySize(java.lang.Number keySize)
KeySize is the key bit size of the corresponding private key for this certificate. If `keyAlgorithm` is set to `RSA`, valid values are `2048`, `4096` or `8192`, and will default to `2048` if not specified. If `keyAlgorithm` is set to `ECDSA`, valid values are `256`, `384` or `521`, and will default to `256` if not specified. No other values are allowed.- Returns:
this
.
-
keystores
public CertificateSpec.Builder keystores(CertificateSpecKeystores keystores)
-
privateKey
public CertificateSpec.Builder privateKey(CertificateSpecPrivateKey privateKey)
-
renewBefore
public CertificateSpec.Builder renewBefore(java.lang.String renewBefore)
The amount of time before the currently issued certificate's `notAfter` time that cert-manager will begin to attempt to renew the certificate. If this value is greater than the total duration of the certificate (i.e. notAfter - notBefore), it will be automatically renewed 2/3rds of the way through the certificate's duration.- Returns:
this
.
-
secretName
public CertificateSpec.Builder secretName(@NonNull @NonNull java.lang.String secretName)
SecretName is the name of the secret resource that will be automatically created and managed by this Certificate resource. It will be populated with a private key and certificate, signed by the denoted issuer.- Returns:
this
.
-
subject
public CertificateSpec.Builder subject(CertificateSpecSubject subject)
-
addToUriSANs
public CertificateSpec.Builder addToUriSANs(java.lang.String addToUriSANs)
-
uriSANs
public CertificateSpec.Builder uriSANs(java.util.Collection<? extends java.lang.String> uriSANs)
-
clearUriSANs
public CertificateSpec.Builder clearUriSANs()
-
addToUsages
public CertificateSpec.Builder addToUsages(java.lang.String addToUsages)
-
usages
public CertificateSpec.Builder usages(java.util.Collection<? extends java.lang.String> usages)
-
clearUsages
public CertificateSpec.Builder clearUsages()
-
build
public CertificateSpec build()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-