Class X509v3Extensions.Builder

java.lang.Object
security.whisper.javastix.coo.types.X509v3Extensions.Builder
Enclosing class:
X509v3Extensions

@NotThreadSafe public static final class X509v3Extensions.Builder extends Object
Builds instances of type X509v3Extensions. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final X509v3Extensions.Builder from(StixCustomProperties instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.common.StixCustomProperties instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final X509v3Extensions.Builder from(X509v3ExtensionsObj instance)
      Fill a builder with attribute values from the provided security.whisper.javastix.coo.types.X509v3ExtensionsObj instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • basicConstraints

      @CanIgnoreReturnValue public final X509v3Extensions.Builder basicConstraints(String basicConstraints)
      Initializes the optional value basicConstraints to basicConstraints.
      Parameters:
      basicConstraints - The value for basicConstraints
      Returns:
      this builder for chained invocation
    • basicConstraints

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies a multi-valued extension which indicates whether a certificate is a CA certificate.") public final X509v3Extensions.Builder basicConstraints(Optional<String> basicConstraints)
      Initializes the optional value basicConstraints to basicConstraints.
      Parameters:
      basicConstraints - The value for basicConstraints
      Returns:
      this builder for use in a chained invocation
    • nameConstraints

      @CanIgnoreReturnValue public final X509v3Extensions.Builder nameConstraints(String nameConstraints)
      Initializes the optional value nameConstraints to nameConstraints.
      Parameters:
      nameConstraints - The value for nameConstraints
      Returns:
      this builder for chained invocation
    • nameConstraints

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies a namespace within which all subject names in subsequent certificates in a certification path MUST be located.") public final X509v3Extensions.Builder nameConstraints(Optional<String> nameConstraints)
      Initializes the optional value nameConstraints to nameConstraints.
      Parameters:
      nameConstraints - The value for nameConstraints
      Returns:
      this builder for use in a chained invocation
    • policyConstraints

      @CanIgnoreReturnValue public final X509v3Extensions.Builder policyConstraints(String policyConstraints)
      Initializes the optional value policyConstraints to policyConstraints.
      Parameters:
      policyConstraints - The value for policyConstraints
      Returns:
      this builder for chained invocation
    • policyConstraints

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies any constraints on path validation for certificates issued to CAs.") public final X509v3Extensions.Builder policyConstraints(Optional<String> policyConstraints)
      Initializes the optional value policyConstraints to policyConstraints.
      Parameters:
      policyConstraints - The value for policyConstraints
      Returns:
      this builder for use in a chained invocation
    • keyUsage

      @CanIgnoreReturnValue public final X509v3Extensions.Builder keyUsage(String keyUsage)
      Initializes the optional value keyUsage to keyUsage.
      Parameters:
      keyUsage - The value for keyUsage
      Returns:
      this builder for chained invocation
    • keyUsage

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies a multi-valued extension consisting of a list of names of the permitted key usages.") public final X509v3Extensions.Builder keyUsage(Optional<String> keyUsage)
      Initializes the optional value keyUsage to keyUsage.
      Parameters:
      keyUsage - The value for keyUsage
      Returns:
      this builder for use in a chained invocation
    • extendedKeyUsage

      @CanIgnoreReturnValue public final X509v3Extensions.Builder extendedKeyUsage(String extendedKeyUsage)
      Initializes the optional value extendedKeyUsage to extendedKeyUsage.
      Parameters:
      extendedKeyUsage - The value for extendedKeyUsage
      Returns:
      this builder for chained invocation
    • extendedKeyUsage

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies a list of usages indicating purposes for which the certificate public key can be used for.") public final X509v3Extensions.Builder extendedKeyUsage(Optional<String> extendedKeyUsage)
      Initializes the optional value extendedKeyUsage to extendedKeyUsage.
      Parameters:
      extendedKeyUsage - The value for extendedKeyUsage
      Returns:
      this builder for use in a chained invocation
    • subjectKeyIdentifier

      @CanIgnoreReturnValue public final X509v3Extensions.Builder subjectKeyIdentifier(String subjectKeyIdentifier)
      Initializes the optional value subjectKeyIdentifier to subjectKeyIdentifier.
      Parameters:
      subjectKeyIdentifier - The value for subjectKeyIdentifier
      Returns:
      this builder for chained invocation
    • subjectKeyIdentifier

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the identifier that provides a means of identifying certificates that contain a particular public key.") public final X509v3Extensions.Builder subjectKeyIdentifier(Optional<String> subjectKeyIdentifier)
      Initializes the optional value subjectKeyIdentifier to subjectKeyIdentifier.
      Parameters:
      subjectKeyIdentifier - The value for subjectKeyIdentifier
      Returns:
      this builder for use in a chained invocation
    • authorityKeyIdentifier

      @CanIgnoreReturnValue public final X509v3Extensions.Builder authorityKeyIdentifier(String authorityKeyIdentifier)
      Initializes the optional value authorityKeyIdentifier to authorityKeyIdentifier.
      Parameters:
      authorityKeyIdentifier - The value for authorityKeyIdentifier
      Returns:
      this builder for chained invocation
    • authorityKeyIdentifier

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the identifier that provides a means of identifying the public key corresponding to the key used to sign a certificate.") public final X509v3Extensions.Builder authorityKeyIdentifier(Optional<String> authorityKeyIdentifier)
      Initializes the optional value authorityKeyIdentifier to authorityKeyIdentifier.
      Parameters:
      authorityKeyIdentifier - The value for authorityKeyIdentifier
      Returns:
      this builder for use in a chained invocation
    • subjectAlternativeName

      @CanIgnoreReturnValue public final X509v3Extensions.Builder subjectAlternativeName(String subjectAlternativeName)
      Initializes the optional value subjectAlternativeName to subjectAlternativeName.
      Parameters:
      subjectAlternativeName - The value for subjectAlternativeName
      Returns:
      this builder for chained invocation
    • subjectAlternativeName

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the additional identities to be bound to the subject of the certificate.") public final X509v3Extensions.Builder subjectAlternativeName(Optional<String> subjectAlternativeName)
      Initializes the optional value subjectAlternativeName to subjectAlternativeName.
      Parameters:
      subjectAlternativeName - The value for subjectAlternativeName
      Returns:
      this builder for use in a chained invocation
    • issuerAlternativeName

      @CanIgnoreReturnValue public final X509v3Extensions.Builder issuerAlternativeName(String issuerAlternativeName)
      Initializes the optional value issuerAlternativeName to issuerAlternativeName.
      Parameters:
      issuerAlternativeName - The value for issuerAlternativeName
      Returns:
      this builder for chained invocation
    • issuerAlternativeName

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the additional identities to be bound to the issuer of the certificate.") public final X509v3Extensions.Builder issuerAlternativeName(Optional<String> issuerAlternativeName)
      Initializes the optional value issuerAlternativeName to issuerAlternativeName.
      Parameters:
      issuerAlternativeName - The value for issuerAlternativeName
      Returns:
      this builder for use in a chained invocation
    • subjectDirectoryAttributes

      @CanIgnoreReturnValue public final X509v3Extensions.Builder subjectDirectoryAttributes(String subjectDirectoryAttributes)
      Initializes the optional value subjectDirectoryAttributes to subjectDirectoryAttributes.
      Parameters:
      subjectDirectoryAttributes - The value for subjectDirectoryAttributes
      Returns:
      this builder for chained invocation
    • subjectDirectoryAttributes

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the identification attributes (e.g., nationality) of the subject.") public final X509v3Extensions.Builder subjectDirectoryAttributes(Optional<String> subjectDirectoryAttributes)
      Initializes the optional value subjectDirectoryAttributes to subjectDirectoryAttributes.
      Parameters:
      subjectDirectoryAttributes - The value for subjectDirectoryAttributes
      Returns:
      this builder for use in a chained invocation
    • crlDistributionPoints

      @CanIgnoreReturnValue public final X509v3Extensions.Builder crlDistributionPoints(String crlDistributionPoints)
      Initializes the optional value crlDistributionPoints to crlDistributionPoints.
      Parameters:
      crlDistributionPoints - The value for crlDistributionPoints
      Returns:
      this builder for chained invocation
    • crlDistributionPoints

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies how CRL information is obtained.") public final X509v3Extensions.Builder crlDistributionPoints(Optional<String> crlDistributionPoints)
      Initializes the optional value crlDistributionPoints to crlDistributionPoints.
      Parameters:
      crlDistributionPoints - The value for crlDistributionPoints
      Returns:
      this builder for use in a chained invocation
    • inhibitAnyPolicy

      @CanIgnoreReturnValue public final X509v3Extensions.Builder inhibitAnyPolicy(String inhibitAnyPolicy)
      Initializes the optional value inhibitAnyPolicy to inhibitAnyPolicy.
      Parameters:
      inhibitAnyPolicy - The value for inhibitAnyPolicy
      Returns:
      this builder for chained invocation
    • inhibitAnyPolicy

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the number of additional certificates that may appear in the path before anyPolicy is no longer permitted.") public final X509v3Extensions.Builder inhibitAnyPolicy(Optional<String> inhibitAnyPolicy)
      Initializes the optional value inhibitAnyPolicy to inhibitAnyPolicy.
      Parameters:
      inhibitAnyPolicy - The value for inhibitAnyPolicy
      Returns:
      this builder for use in a chained invocation
    • privateKeyUsagePeriodNotBefore

      @CanIgnoreReturnValue public final X509v3Extensions.Builder privateKeyUsagePeriodNotBefore(StixInstant privateKeyUsagePeriodNotBefore)
      Initializes the optional value privateKeyUsagePeriodNotBefore to privateKeyUsagePeriodNotBefore.
      Parameters:
      privateKeyUsagePeriodNotBefore - The value for privateKeyUsagePeriodNotBefore
      Returns:
      this builder for chained invocation
    • privateKeyUsagePeriodNotBefore

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date on which the validity period begins for the key, if it is different from the validity period of the certificate.") public final X509v3Extensions.Builder privateKeyUsagePeriodNotBefore(Optional<? extends StixInstant> privateKeyUsagePeriodNotBefore)
      Initializes the optional value privateKeyUsagePeriodNotBefore to privateKeyUsagePeriodNotBefore.
      Parameters:
      privateKeyUsagePeriodNotBefore - The value for privateKeyUsagePeriodNotBefore
      Returns:
      this builder for use in a chained invocation
    • privateKeyUsagePeriodNotAfter

      @CanIgnoreReturnValue public final X509v3Extensions.Builder privateKeyUsagePeriodNotAfter(StixInstant privateKeyUsagePeriodNotAfter)
      Initializes the optional value privateKeyUsagePeriodNotAfter to privateKeyUsagePeriodNotAfter.
      Parameters:
      privateKeyUsagePeriodNotAfter - The value for privateKeyUsagePeriodNotAfter
      Returns:
      this builder for chained invocation
    • privateKeyUsagePeriodNotAfter

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date on which the validity period ends for the key, if it is different from the validity period of the certificate.") public final X509v3Extensions.Builder privateKeyUsagePeriodNotAfter(Optional<? extends StixInstant> privateKeyUsagePeriodNotAfter)
      Initializes the optional value privateKeyUsagePeriodNotAfter to privateKeyUsagePeriodNotAfter.
      Parameters:
      privateKeyUsagePeriodNotAfter - The value for privateKeyUsagePeriodNotAfter
      Returns:
      this builder for use in a chained invocation
    • certificatePolicies

      @CanIgnoreReturnValue public final X509v3Extensions.Builder certificatePolicies(String certificatePolicies)
      Initializes the optional value certificatePolicies to certificatePolicies.
      Parameters:
      certificatePolicies - The value for certificatePolicies
      Returns:
      this builder for chained invocation
    • certificatePolicies

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers.") public final X509v3Extensions.Builder certificatePolicies(Optional<String> certificatePolicies)
      Initializes the optional value certificatePolicies to certificatePolicies.
      Parameters:
      certificatePolicies - The value for certificatePolicies
      Returns:
      this builder for use in a chained invocation
    • policyMappings

      @CanIgnoreReturnValue public final X509v3Extensions.Builder policyMappings(String policyMappings)
      Initializes the optional value policyMappings to policyMappings.
      Parameters:
      policyMappings - The value for policyMappings
      Returns:
      this builder for chained invocation
    • policyMappings

      @CanIgnoreReturnValue @JsonPropertyDescription("Specifies one or more pairs of OIDs(); each pair includes an issuerDomainPolicy and a subjectDomainPolicy") public final X509v3Extensions.Builder policyMappings(Optional<String> policyMappings)
      Initializes the optional value policyMappings to policyMappings.
      Parameters:
      policyMappings - The value for policyMappings
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final X509v3Extensions.Builder putCustomProperty(String key, Object value)
      Put one entry to the customProperties map.
      Parameters:
      key - The key in the customProperties map
      value - The associated value in the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putCustomProperty

      @CanIgnoreReturnValue public final X509v3Extensions.Builder putCustomProperty(Map.Entry<String,? extends Object> entry)
      Put one entry to the customProperties map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • customProperties

      @CanIgnoreReturnValue public final X509v3Extensions.Builder customProperties(Map<String,? extends Object> entries)
      Sets or replaces all mappings from the specified map as entries for the customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • putAllCustomProperties

      @CanIgnoreReturnValue public final X509v3Extensions.Builder putAllCustomProperties(Map<String,? extends Object> entries)
      Put all mappings from the specified map as entries to customProperties map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the customProperties map
      Returns:
      this builder for use in a chained invocation
    • build

      public X509v3Extensions build()
      Builds a new X509v3Extensions.
      Returns:
      An immutable instance of X509v3Extensions
      Throws:
      IllegalStateException - if any required attributes are missing