Class CertificateSpec.Builder

  • Enclosing class:
    CertificateSpec

    public static class CertificateSpec.Builder
    extends java.lang.Object
    • 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.
      • dnsNames

        public CertificateSpec.Builder dnsNames​(java.util.Collection<? extends java.lang.String> dnsNames)
      • 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.
      • emailSANs

        public CertificateSpec.Builder emailSANs​(java.util.Collection<? extends java.lang.String> emailSANs)
      • encodeUsagesInRequest

        public CertificateSpec.Builder encodeUsagesInRequest​(java.lang.Boolean encodeUsagesInRequest)
        EncodeUsagesInRequest controls whether key usages should be present in the CertificateRequest
        Returns:
        this.
      • ipAddresses

        public CertificateSpec.Builder ipAddresses​(java.util.Collection<? extends java.lang.String> ipAddresses)
      • 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.
      • 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.
      • 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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object