Class X509v3Extensions

java.lang.Object
security.whisper.javastix.coo.types.X509v3Extensions
All Implemented Interfaces:
Serializable, StixCustomProperties, X509v3ExtensionsObj, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class X509v3Extensions extends Object implements X509v3ExtensionsObj
x509-certificate

The X509 Certificate Object represents the properties of an X.509 certificate. Note that the X.509 v3 Extensions type is not a STIX Cyber Observables extension, it is a type that describes X.509 extensions.

See Also:
  • Method Details

    • getBasicConstraints

      @JsonPropertyDescription("Specifies a multi-valued extension which indicates whether a certificate is a CA certificate.") public Optional<String> getBasicConstraints()
      Specified by:
      getBasicConstraints in interface X509v3ExtensionsObj
      Returns:
      The value of the basicConstraints attribute
    • getNameConstraints

      @JsonPropertyDescription("Specifies a namespace within which all subject names in subsequent certificates in a certification path MUST be located.") public Optional<String> getNameConstraints()
      Specified by:
      getNameConstraints in interface X509v3ExtensionsObj
      Returns:
      The value of the nameConstraints attribute
    • getPolicyConstraints

      @JsonPropertyDescription("Specifies any constraints on path validation for certificates issued to CAs.") public Optional<String> getPolicyConstraints()
      Specified by:
      getPolicyConstraints in interface X509v3ExtensionsObj
      Returns:
      The value of the policyConstraints attribute
    • getKeyUsage

      @JsonPropertyDescription("Specifies a multi-valued extension consisting of a list of names of the permitted key usages.") public Optional<String> getKeyUsage()
      Specified by:
      getKeyUsage in interface X509v3ExtensionsObj
      Returns:
      The value of the keyUsage attribute
    • getExtendedKeyUsage

      @JsonPropertyDescription("Specifies a list of usages indicating purposes for which the certificate public key can be used for.") public Optional<String> getExtendedKeyUsage()
      Specified by:
      getExtendedKeyUsage in interface X509v3ExtensionsObj
      Returns:
      The value of the extendedKeyUsage attribute
    • getSubjectKeyIdentifier

      @JsonPropertyDescription("Specifies the identifier that provides a means of identifying certificates that contain a particular public key.") public Optional<String> getSubjectKeyIdentifier()
      Specified by:
      getSubjectKeyIdentifier in interface X509v3ExtensionsObj
      Returns:
      The value of the subjectKeyIdentifier attribute
    • getAuthorityKeyIdentifier

      @JsonPropertyDescription("Specifies the identifier that provides a means of identifying the public key corresponding to the key used to sign a certificate.") public Optional<String> getAuthorityKeyIdentifier()
      Specified by:
      getAuthorityKeyIdentifier in interface X509v3ExtensionsObj
      Returns:
      The value of the authorityKeyIdentifier attribute
    • getSubjectAlternativeName

      @JsonPropertyDescription("Specifies the additional identities to be bound to the subject of the certificate.") public Optional<String> getSubjectAlternativeName()
      Specified by:
      getSubjectAlternativeName in interface X509v3ExtensionsObj
      Returns:
      The value of the subjectAlternativeName attribute
    • getIssuerAlternativeName

      @JsonPropertyDescription("Specifies the additional identities to be bound to the issuer of the certificate.") public Optional<String> getIssuerAlternativeName()
      Specified by:
      getIssuerAlternativeName in interface X509v3ExtensionsObj
      Returns:
      The value of the issuerAlternativeName attribute
    • getSubjectDirectoryAttributes

      @JsonPropertyDescription("Specifies the identification attributes (e.g., nationality) of the subject.") public Optional<String> getSubjectDirectoryAttributes()
      Specified by:
      getSubjectDirectoryAttributes in interface X509v3ExtensionsObj
      Returns:
      The value of the subjectDirectoryAttributes attribute
    • getCrlDistributionPoints

      @JsonPropertyDescription("Specifies how CRL information is obtained.") public Optional<String> getCrlDistributionPoints()
      Specified by:
      getCrlDistributionPoints in interface X509v3ExtensionsObj
      Returns:
      The value of the crlDistributionPoints attribute
    • getInhibitAnyPolicy

      @JsonPropertyDescription("Specifies the number of additional certificates that may appear in the path before anyPolicy is no longer permitted.") public Optional<String> getInhibitAnyPolicy()
      Specified by:
      getInhibitAnyPolicy in interface X509v3ExtensionsObj
      Returns:
      The value of the inhibitAnyPolicy attribute
    • getPrivateKeyUsagePeriodNotBefore

      @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 Optional<StixInstant> getPrivateKeyUsagePeriodNotBefore()
      Specified by:
      getPrivateKeyUsagePeriodNotBefore in interface X509v3ExtensionsObj
      Returns:
      The value of the privateKeyUsagePeriodNotBefore attribute
    • getPrivateKeyUsagePeriodNotAfter

      @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 Optional<StixInstant> getPrivateKeyUsagePeriodNotAfter()
      Specified by:
      getPrivateKeyUsagePeriodNotAfter in interface X509v3ExtensionsObj
      Returns:
      The value of the privateKeyUsagePeriodNotAfter attribute
    • getCertificatePolicies

      @JsonPropertyDescription("Specifies a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers.") public Optional<String> getCertificatePolicies()
      Specified by:
      getCertificatePolicies in interface X509v3ExtensionsObj
      Returns:
      The value of the certificatePolicies attribute
    • getPolicyMappings

      @JsonPropertyDescription("Specifies one or more pairs of OIDs(); each pair includes an issuerDomainPolicy and a subjectDomainPolicy") public Optional<String> getPolicyMappings()
      Specified by:
      getPolicyMappings in interface X509v3ExtensionsObj
      Returns:
      The value of the policyMappings attribute
    • getCustomProperties

      public com.google.common.collect.ImmutableMap<String,Object> getCustomProperties()
      Custom Properties for STIX Objects. Any object that supports custom properties will have a validation of the custom property prefix (typically "x_"). If the additional property in the JSON does not meet the StartsWith condition, then the JSON will be rejected.
      Specified by:
      getCustomProperties in interface StixCustomProperties
      Returns:
      Map of custom properties Map<String, Object>
    • withBasicConstraints

      public final X509v3Extensions withBasicConstraints(String value)
      Copy the current immutable object by setting a present value for the optional basicConstraints attribute.
      Parameters:
      value - The value for basicConstraints
      Returns:
      A modified copy of this object
    • withBasicConstraints

      public final X509v3Extensions withBasicConstraints(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the basicConstraints attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for basicConstraints
      Returns:
      A modified copy of this object
    • withNameConstraints

      public final X509v3Extensions withNameConstraints(String value)
      Copy the current immutable object by setting a present value for the optional nameConstraints attribute.
      Parameters:
      value - The value for nameConstraints
      Returns:
      A modified copy of this object
    • withNameConstraints

      public final X509v3Extensions withNameConstraints(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the nameConstraints attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for nameConstraints
      Returns:
      A modified copy of this object
    • withPolicyConstraints

      public final X509v3Extensions withPolicyConstraints(String value)
      Copy the current immutable object by setting a present value for the optional policyConstraints attribute.
      Parameters:
      value - The value for policyConstraints
      Returns:
      A modified copy of this object
    • withPolicyConstraints

      public final X509v3Extensions withPolicyConstraints(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the policyConstraints attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for policyConstraints
      Returns:
      A modified copy of this object
    • withKeyUsage

      public final X509v3Extensions withKeyUsage(String value)
      Copy the current immutable object by setting a present value for the optional keyUsage attribute.
      Parameters:
      value - The value for keyUsage
      Returns:
      A modified copy of this object
    • withKeyUsage

      public final X509v3Extensions withKeyUsage(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the keyUsage attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for keyUsage
      Returns:
      A modified copy of this object
    • withExtendedKeyUsage

      public final X509v3Extensions withExtendedKeyUsage(String value)
      Copy the current immutable object by setting a present value for the optional extendedKeyUsage attribute.
      Parameters:
      value - The value for extendedKeyUsage
      Returns:
      A modified copy of this object
    • withExtendedKeyUsage

      public final X509v3Extensions withExtendedKeyUsage(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the extendedKeyUsage attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for extendedKeyUsage
      Returns:
      A modified copy of this object
    • withSubjectKeyIdentifier

      public final X509v3Extensions withSubjectKeyIdentifier(String value)
      Copy the current immutable object by setting a present value for the optional subjectKeyIdentifier attribute.
      Parameters:
      value - The value for subjectKeyIdentifier
      Returns:
      A modified copy of this object
    • withSubjectKeyIdentifier

      public final X509v3Extensions withSubjectKeyIdentifier(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the subjectKeyIdentifier attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for subjectKeyIdentifier
      Returns:
      A modified copy of this object
    • withAuthorityKeyIdentifier

      public final X509v3Extensions withAuthorityKeyIdentifier(String value)
      Copy the current immutable object by setting a present value for the optional authorityKeyIdentifier attribute.
      Parameters:
      value - The value for authorityKeyIdentifier
      Returns:
      A modified copy of this object
    • withAuthorityKeyIdentifier

      public final X509v3Extensions withAuthorityKeyIdentifier(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the authorityKeyIdentifier attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for authorityKeyIdentifier
      Returns:
      A modified copy of this object
    • withSubjectAlternativeName

      public final X509v3Extensions withSubjectAlternativeName(String value)
      Copy the current immutable object by setting a present value for the optional subjectAlternativeName attribute.
      Parameters:
      value - The value for subjectAlternativeName
      Returns:
      A modified copy of this object
    • withSubjectAlternativeName

      public final X509v3Extensions withSubjectAlternativeName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the subjectAlternativeName attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for subjectAlternativeName
      Returns:
      A modified copy of this object
    • withIssuerAlternativeName

      public final X509v3Extensions withIssuerAlternativeName(String value)
      Copy the current immutable object by setting a present value for the optional issuerAlternativeName attribute.
      Parameters:
      value - The value for issuerAlternativeName
      Returns:
      A modified copy of this object
    • withIssuerAlternativeName

      public final X509v3Extensions withIssuerAlternativeName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the issuerAlternativeName attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for issuerAlternativeName
      Returns:
      A modified copy of this object
    • withSubjectDirectoryAttributes

      public final X509v3Extensions withSubjectDirectoryAttributes(String value)
      Copy the current immutable object by setting a present value for the optional subjectDirectoryAttributes attribute.
      Parameters:
      value - The value for subjectDirectoryAttributes
      Returns:
      A modified copy of this object
    • withSubjectDirectoryAttributes

      public final X509v3Extensions withSubjectDirectoryAttributes(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the subjectDirectoryAttributes attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for subjectDirectoryAttributes
      Returns:
      A modified copy of this object
    • withCrlDistributionPoints

      public final X509v3Extensions withCrlDistributionPoints(String value)
      Copy the current immutable object by setting a present value for the optional crlDistributionPoints attribute.
      Parameters:
      value - The value for crlDistributionPoints
      Returns:
      A modified copy of this object
    • withCrlDistributionPoints

      public final X509v3Extensions withCrlDistributionPoints(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the crlDistributionPoints attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for crlDistributionPoints
      Returns:
      A modified copy of this object
    • withInhibitAnyPolicy

      public final X509v3Extensions withInhibitAnyPolicy(String value)
      Copy the current immutable object by setting a present value for the optional inhibitAnyPolicy attribute.
      Parameters:
      value - The value for inhibitAnyPolicy
      Returns:
      A modified copy of this object
    • withInhibitAnyPolicy

      public final X509v3Extensions withInhibitAnyPolicy(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the inhibitAnyPolicy attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for inhibitAnyPolicy
      Returns:
      A modified copy of this object
    • withPrivateKeyUsagePeriodNotBefore

      public final X509v3Extensions withPrivateKeyUsagePeriodNotBefore(StixInstant value)
      Copy the current immutable object by setting a present value for the optional privateKeyUsagePeriodNotBefore attribute.
      Parameters:
      value - The value for privateKeyUsagePeriodNotBefore
      Returns:
      A modified copy of this object
    • withPrivateKeyUsagePeriodNotBefore

      public final X509v3Extensions withPrivateKeyUsagePeriodNotBefore(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the privateKeyUsagePeriodNotBefore attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for privateKeyUsagePeriodNotBefore
      Returns:
      A modified copy of this object
    • withPrivateKeyUsagePeriodNotAfter

      public final X509v3Extensions withPrivateKeyUsagePeriodNotAfter(StixInstant value)
      Copy the current immutable object by setting a present value for the optional privateKeyUsagePeriodNotAfter attribute.
      Parameters:
      value - The value for privateKeyUsagePeriodNotAfter
      Returns:
      A modified copy of this object
    • withPrivateKeyUsagePeriodNotAfter

      public final X509v3Extensions withPrivateKeyUsagePeriodNotAfter(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the privateKeyUsagePeriodNotAfter attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for privateKeyUsagePeriodNotAfter
      Returns:
      A modified copy of this object
    • withCertificatePolicies

      public final X509v3Extensions withCertificatePolicies(String value)
      Copy the current immutable object by setting a present value for the optional certificatePolicies attribute.
      Parameters:
      value - The value for certificatePolicies
      Returns:
      A modified copy of this object
    • withCertificatePolicies

      public final X509v3Extensions withCertificatePolicies(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the certificatePolicies attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for certificatePolicies
      Returns:
      A modified copy of this object
    • withPolicyMappings

      public final X509v3Extensions withPolicyMappings(String value)
      Copy the current immutable object by setting a present value for the optional policyMappings attribute.
      Parameters:
      value - The value for policyMappings
      Returns:
      A modified copy of this object
    • withPolicyMappings

      public final X509v3Extensions withPolicyMappings(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the policyMappings attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for policyMappings
      Returns:
      A modified copy of this object
    • withCustomProperties

      public final X509v3Extensions withCustomProperties(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the customProperties map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the customProperties map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of X509v3Extensions that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: basicConstraints, nameConstraints, policyConstraints, keyUsage, extendedKeyUsage, subjectKeyIdentifier, authorityKeyIdentifier, subjectAlternativeName, issuerAlternativeName, subjectDirectoryAttributes, crlDistributionPoints, inhibitAnyPolicy, privateKeyUsagePeriodNotBefore, privateKeyUsagePeriodNotAfter, certificatePolicies, policyMappings, customProperties.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value X509v3Extensions with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static X509v3Extensions copyOf(X509v3ExtensionsObj instance)
      Creates an immutable copy of a X509v3ExtensionsObj value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable X509v3Extensions instance
    • builder

      public static X509v3Extensions.Builder builder()
      Creates a builder for X509v3Extensions.
      Returns:
      A new X509v3Extensions builder