Class X509Certificate
java.lang.Object
security.whisper.javastix.coo.objects.X509Certificate
- All Implemented Interfaces:
Serializable,BundleableObject,Stix,StixCustomProperties,CyberObservableObject,CyberObservableObjectCommonProperties,X509CertificateCoo,GenericValidation,SdoDefaultValidator
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class X509Certificate
extends Object
implements X509CertificateCoo
x509-certificate
The X509 Certificate Object represents the properties of an X.509 certificate.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
VALIDATOR -
Method Summary
Modifier and TypeMethodDescriptionstatic X509Certificate.Builderbuilder()Creates a builder forX509Certificate.static X509CertificatecopyOf(X509CertificateCoo instance) Creates an immutable copy of aX509CertificateCoovalue.booleanThis instance is equal to all instances ofX509Certificatethat have equal attribute values.Custom Properties for STIX Objects.Indicates whether the data contained in the SCO has been defanged.com.google.common.collect.ImmutableSet<CyberObservableExtension> Multiple extensions can be added, but only 1 instance of a specific extension can be added.com.google.common.collect.ImmutableSet<GranularMarkingDm> booleangetId()Deterministically generates the ID for this X.509 certificate based on its serial number, hashes, or subject.com.google.common.collect.ImmutableSet<MarkingDefinitionDm> Used for generation of Map Keys byManually set this value if you want to control key names.invalid reference
ObservedDataSdo#getObjects()getType()inthashCode()Computes a hash code from attributes:isSelfSigned,hashes,version,serialNumber,signatureAlgorithm,issuer,validityNotBefore,validityNotAfter,subject,subjectPublicKeyAlgorithm,subjectPublicKeyModulus,subjectPublicKeyExponent,x509V3Extensions,id,type,extensions,observableObjectKey,defanged,customProperties,objectMarkingRefs,granularMarkings,hydrated,toJsonString.toString()Prints the immutable valueX509Certificatewith attribute values.final X509CertificatewithCustomProperties(Map<String, ? extends Object> entries) Copy the current immutable object by replacing thecustomPropertiesmap with the specified map.final X509CertificatewithDefanged(boolean value) Copy the current immutable object by setting a present value for the optionaldefangedattribute.final X509CertificatewithDefanged(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for thedefangedattribute.final X509CertificatewithExtensions(Iterable<? extends CyberObservableExtension> elements) Copy the current immutable object with elements that replace the content ofextensions.final X509CertificatewithExtensions(CyberObservableExtension... elements) Copy the current immutable object with elements that replace the content ofextensions.final X509CertificatewithGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Copy the current immutable object with elements that replace the content ofgranularMarkings.final X509CertificatewithGranularMarkings(GranularMarkingDm... elements) Copy the current immutable object with elements that replace the content ofgranularMarkings.final X509CertificatewithHashes(Map<String, ? extends String> entries) Copy the current immutable object by replacing thehashesmap with the specified map.final X509CertificatewithHydrated(boolean value) Copy the current immutable object by setting a value for thehydratedattribute.final X509CertificatewithIsSelfSigned(boolean value) Copy the current immutable object by setting a present value for the optionalisSelfSignedattribute.final X509CertificatewithIsSelfSigned(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for theisSelfSignedattribute.final X509CertificatewithIssuer(String value) Copy the current immutable object by setting a present value for the optionalissuerattribute.final X509CertificatewithIssuer(Optional<String> optional) Copy the current immutable object by setting an optional value for theissuerattribute.final X509CertificatewithObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Copy the current immutable object with elements that replace the content ofobjectMarkingRefs.final X509CertificatewithObjectMarkingRefs(MarkingDefinitionDm... elements) Copy the current immutable object with elements that replace the content ofobjectMarkingRefs.final X509CertificatewithObservableObjectKey(String value) Copy the current immutable object by setting a value for theobservableObjectKeyattribute.final X509CertificatewithSerialNumber(String value) Copy the current immutable object by setting a present value for the optionalserialNumberattribute.final X509CertificatewithSerialNumber(Optional<String> optional) Copy the current immutable object by setting an optional value for theserialNumberattribute.final X509CertificatewithSignatureAlgorithm(String value) Copy the current immutable object by setting a present value for the optionalsignatureAlgorithmattribute.final X509CertificatewithSignatureAlgorithm(Optional<String> optional) Copy the current immutable object by setting an optional value for thesignatureAlgorithmattribute.final X509CertificatewithSubject(String value) Copy the current immutable object by setting a present value for the optionalsubjectattribute.final X509CertificatewithSubject(Optional<String> optional) Copy the current immutable object by setting an optional value for thesubjectattribute.final X509CertificateCopy the current immutable object by setting a present value for the optionalsubjectPublicKeyAlgorithmattribute.final X509CertificatewithSubjectPublicKeyAlgorithm(Optional<String> optional) Copy the current immutable object by setting an optional value for thesubjectPublicKeyAlgorithmattribute.final X509CertificatewithSubjectPublicKeyExponent(long value) Copy the current immutable object by setting a present value for the optionalsubjectPublicKeyExponentattribute.final X509CertificatewithSubjectPublicKeyExponent(Optional<Long> optional) Copy the current immutable object by setting an optional value for thesubjectPublicKeyExponentattribute.final X509CertificateCopy the current immutable object by setting a present value for the optionalsubjectPublicKeyModulusattribute.final X509CertificatewithSubjectPublicKeyModulus(Optional<String> optional) Copy the current immutable object by setting an optional value for thesubjectPublicKeyModulusattribute.final X509CertificatewithToJsonString(String value) Copy the current immutable object by setting a value for thetoJsonStringattribute.final X509CertificateCopy the current immutable object by setting a value for thetypeattribute.final X509CertificatewithValidityNotAfter(Optional<? extends StixInstant> optional) Copy the current immutable object by setting an optional value for thevalidityNotAfterattribute.final X509CertificatewithValidityNotAfter(StixInstant value) Copy the current immutable object by setting a present value for the optionalvalidityNotAfterattribute.final X509CertificatewithValidityNotBefore(Optional<? extends StixInstant> optional) Copy the current immutable object by setting an optional value for thevalidityNotBeforeattribute.final X509CertificatewithValidityNotBefore(StixInstant value) Copy the current immutable object by setting a present value for the optionalvalidityNotBeforeattribute.final X509CertificatewithVersion(String value) Copy the current immutable object by setting a present value for the optionalversionattribute.final X509CertificatewithVersion(Optional<String> optional) Copy the current immutable object by setting an optional value for theversionattribute.final X509CertificatewithX509V3Extensions(Optional<? extends X509v3ExtensionsObj> optional) Copy the current immutable object by setting an optional value for thex509V3Extensionsattribute.final X509CertificateCopy the current immutable object by setting a present value for the optionalx509V3Extensionsattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface security.whisper.javastix.validation.GenericValidation
validateEntityMethods inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
validate, validateOnlyId
-
Method Details
-
isSelfSigned
@JsonPropertyDescription("Specifies whether the certificate is self-signed, i.e., whether it is signed by the same entity whose identity it certifies.") public Optional<Boolean> isSelfSigned()- Specified by:
isSelfSignedin interfaceX509CertificateCoo- Returns:
- The value of the
isSelfSignedattribute
-
getHashes
@JsonPropertyDescription("Specifies any hashes that were calculated for the entire contents of the certificate.") public com.google.common.collect.ImmutableMap<String,String> getHashes()- Specified by:
getHashesin interfaceX509CertificateCoo- Returns:
- The value of the
hashesattribute
-
getVersion
@JsonPropertyDescription("Specifies the version of the encoded certificate.") public Optional<String> getVersion()- Specified by:
getVersionin interfaceX509CertificateCoo- Returns:
- The value of the
versionattribute
-
getSerialNumber
@JsonPropertyDescription("Specifies the unique identifier for the certificate, as issued by a specific Certificate Authority.") public Optional<String> getSerialNumber()- Specified by:
getSerialNumberin interfaceX509CertificateCoo- Returns:
- The value of the
serialNumberattribute
-
getSignatureAlgorithm
@JsonPropertyDescription("Specifies the name of the algorithm used to sign the certificate.") public Optional<String> getSignatureAlgorithm()- Specified by:
getSignatureAlgorithmin interfaceX509CertificateCoo- Returns:
- The value of the
signatureAlgorithmattribute
-
getIssuer
@JsonPropertyDescription("Specifies the name of the Certificate Authority that issued the certificate.") public Optional<String> getIssuer()- Specified by:
getIssuerin interfaceX509CertificateCoo- Returns:
- The value of the
issuerattribute
-
getValidityNotBefore
@JsonPropertyDescription("Specifies the date on which the certificate validity period begins.") public Optional<StixInstant> getValidityNotBefore()- Specified by:
getValidityNotBeforein interfaceX509CertificateCoo- Returns:
- The value of the
validityNotBeforeattribute
-
getValidityNotAfter
@JsonPropertyDescription("Specifies the date on which the certificate validity period ends.") public Optional<StixInstant> getValidityNotAfter()- Specified by:
getValidityNotAfterin interfaceX509CertificateCoo- Returns:
- The value of the
validityNotAfterattribute
-
getSubject
@JsonPropertyDescription("Specifies the name of the entity associated with the public key stored in the subject public key field of the certificate.") public Optional<String> getSubject()- Specified by:
getSubjectin interfaceX509CertificateCoo- Returns:
- The value of the
subjectattribute
-
getSubjectPublicKeyAlgorithm
@JsonPropertyDescription("Specifies the name of the algorithm with which to encrypt data being sent to the subject.") public Optional<String> getSubjectPublicKeyAlgorithm()- Specified by:
getSubjectPublicKeyAlgorithmin interfaceX509CertificateCoo- Returns:
- The value of the
subjectPublicKeyAlgorithmattribute
-
getSubjectPublicKeyModulus
@JsonPropertyDescription("Specifies the modulus portion of the subject\u2019s public RSA key.") public Optional<String> getSubjectPublicKeyModulus()- Specified by:
getSubjectPublicKeyModulusin interfaceX509CertificateCoo- Returns:
- The value of the
subjectPublicKeyModulusattribute
-
getSubjectPublicKeyExponent
@JsonPropertyDescription("Specifies the exponent portion of the subject\u2019s public RSA key, as an integer.") public Optional<Long> getSubjectPublicKeyExponent()- Specified by:
getSubjectPublicKeyExponentin interfaceX509CertificateCoo- Returns:
- The value of the
subjectPublicKeyExponentattribute
-
getX509V3Extensions
@JsonPropertyDescription("Specifies any standard X.509 v3 extensions that may be used in the certificate.") public Optional<X509v3ExtensionsObj> getX509V3Extensions()- Specified by:
getX509V3Extensionsin interfaceX509CertificateCoo- Returns:
- The value of the
x509V3Extensionsattribute
-
getId
Deterministically generates the ID for this X.509 certificate based on its serial number, hashes, or subject.- Specified by:
getIdin interfaceBundleableObject- Specified by:
getIdin interfaceCyberObservableObjectCommonProperties- Specified by:
getIdin interfaceX509CertificateCoo
-
getType
- Specified by:
getTypein interfaceBundleableObject- Specified by:
getTypein interfaceCyberObservableObjectCommonProperties- Returns:
- The value of the
typeattribute
-
getExtensions
@JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public com.google.common.collect.ImmutableSet<CyberObservableExtension> getExtensions()Multiple extensions can be added, but only 1 instance of a specific extension can be added.- Specified by:
getExtensionsin interfaceCyberObservableObjectCommonProperties
-
getObservableObjectKey
Used for generation of Map Keys byManually set this value if you want to control key names. Otherwise UUIDs will be used.invalid reference
ObservedDataSdo#getObjects()- Specified by:
getObservableObjectKeyin interfaceCyberObservableObjectCommonProperties
-
getDefanged
@JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public Optional<Boolean> getDefanged()Indicates whether the data contained in the SCO has been defanged. Defanging refers to the process of modifying data to make it safe to handle (e.g., changing an IP address from 192.168.1.1 to 192[.]168[.]1[.]1).- Specified by:
getDefangedin interfaceCyberObservableObjectCommonProperties
-
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:
getCustomPropertiesin interfaceStixCustomProperties- Returns:
- Map of custom properties
Map<String, Object>
-
getObjectMarkingRefs
- Specified by:
getObjectMarkingRefsin interfaceBundleableObject- Returns:
- The value of the
objectMarkingRefsattribute
-
getGranularMarkings
- Specified by:
getGranularMarkingsin interfaceBundleableObject- Returns:
- The value of the
granularMarkingsattribute
-
getHydrated
public boolean getHydrated()- Specified by:
getHydratedin interfaceBundleableObject- Returns:
- The value of the
hydratedattribute
-
toJsonString
- Specified by:
toJsonStringin interfaceBundleableObject- Returns:
- The value of the
toJsonStringattribute
-
withIsSelfSigned
Copy the current immutable object by setting a present value for the optionalisSelfSignedattribute.- Parameters:
value- The value for isSelfSigned- Returns:
- A modified copy of
thisobject
-
withIsSelfSigned
Copy the current immutable object by setting an optional value for theisSelfSignedattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for isSelfSigned- Returns:
- A modified copy of
thisobject
-
withHashes
Copy the current immutable object by replacing thehashesmap 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 returningthis.- Parameters:
entries- The entries to be added to the hashes map- Returns:
- A modified copy of
thisobject
-
withVersion
Copy the current immutable object by setting a present value for the optionalversionattribute.- Parameters:
value- The value for version- Returns:
- A modified copy of
thisobject
-
withVersion
Copy the current immutable object by setting an optional value for theversionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for version- Returns:
- A modified copy of
thisobject
-
withSerialNumber
Copy the current immutable object by setting a present value for the optionalserialNumberattribute.- Parameters:
value- The value for serialNumber- Returns:
- A modified copy of
thisobject
-
withSerialNumber
Copy the current immutable object by setting an optional value for theserialNumberattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for serialNumber- Returns:
- A modified copy of
thisobject
-
withSignatureAlgorithm
Copy the current immutable object by setting a present value for the optionalsignatureAlgorithmattribute.- Parameters:
value- The value for signatureAlgorithm- Returns:
- A modified copy of
thisobject
-
withSignatureAlgorithm
Copy the current immutable object by setting an optional value for thesignatureAlgorithmattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for signatureAlgorithm- Returns:
- A modified copy of
thisobject
-
withIssuer
Copy the current immutable object by setting a present value for the optionalissuerattribute.- Parameters:
value- The value for issuer- Returns:
- A modified copy of
thisobject
-
withIssuer
Copy the current immutable object by setting an optional value for theissuerattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for issuer- Returns:
- A modified copy of
thisobject
-
withValidityNotBefore
Copy the current immutable object by setting a present value for the optionalvalidityNotBeforeattribute.- Parameters:
value- The value for validityNotBefore- Returns:
- A modified copy of
thisobject
-
withValidityNotBefore
Copy the current immutable object by setting an optional value for thevalidityNotBeforeattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for validityNotBefore- Returns:
- A modified copy of
thisobject
-
withValidityNotAfter
Copy the current immutable object by setting a present value for the optionalvalidityNotAfterattribute.- Parameters:
value- The value for validityNotAfter- Returns:
- A modified copy of
thisobject
-
withValidityNotAfter
Copy the current immutable object by setting an optional value for thevalidityNotAfterattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for validityNotAfter- Returns:
- A modified copy of
thisobject
-
withSubject
Copy the current immutable object by setting a present value for the optionalsubjectattribute.- Parameters:
value- The value for subject- Returns:
- A modified copy of
thisobject
-
withSubject
Copy the current immutable object by setting an optional value for thesubjectattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for subject- Returns:
- A modified copy of
thisobject
-
withSubjectPublicKeyAlgorithm
Copy the current immutable object by setting a present value for the optionalsubjectPublicKeyAlgorithmattribute.- Parameters:
value- The value for subjectPublicKeyAlgorithm- Returns:
- A modified copy of
thisobject
-
withSubjectPublicKeyAlgorithm
Copy the current immutable object by setting an optional value for thesubjectPublicKeyAlgorithmattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for subjectPublicKeyAlgorithm- Returns:
- A modified copy of
thisobject
-
withSubjectPublicKeyModulus
Copy the current immutable object by setting a present value for the optionalsubjectPublicKeyModulusattribute.- Parameters:
value- The value for subjectPublicKeyModulus- Returns:
- A modified copy of
thisobject
-
withSubjectPublicKeyModulus
Copy the current immutable object by setting an optional value for thesubjectPublicKeyModulusattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for subjectPublicKeyModulus- Returns:
- A modified copy of
thisobject
-
withSubjectPublicKeyExponent
Copy the current immutable object by setting a present value for the optionalsubjectPublicKeyExponentattribute.- Parameters:
value- The value for subjectPublicKeyExponent- Returns:
- A modified copy of
thisobject
-
withSubjectPublicKeyExponent
Copy the current immutable object by setting an optional value for thesubjectPublicKeyExponentattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for subjectPublicKeyExponent- Returns:
- A modified copy of
thisobject
-
withX509V3Extensions
Copy the current immutable object by setting a present value for the optionalx509V3Extensionsattribute.- Parameters:
value- The value for x509V3Extensions- Returns:
- A modified copy of
thisobject
-
withX509V3Extensions
Copy the current immutable object by setting an optional value for thex509V3Extensionsattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for x509V3Extensions- Returns:
- A modified copy of
thisobject
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of extensions elements to set- Returns:
- A modified copy of
thisobject
-
withObservableObjectKey
Copy the current immutable object by setting a value for theobservableObjectKeyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for observableObjectKey- Returns:
- A modified copy of the
thisobject
-
withDefanged
Copy the current immutable object by setting a present value for the optionaldefangedattribute.- Parameters:
value- The value for defanged- Returns:
- A modified copy of
thisobject
-
withDefanged
Copy the current immutable object by setting an optional value for thedefangedattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for defanged- Returns:
- A modified copy of
thisobject
-
withCustomProperties
Copy the current immutable object by replacing thecustomPropertiesmap 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 returningthis.- Parameters:
entries- The entries to be added to the customProperties map- Returns:
- A modified copy of
thisobject
-
withObjectMarkingRefs
Copy the current immutable object with elements that replace the content ofobjectMarkingRefs.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withObjectMarkingRefs
public final X509Certificate withObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Copy the current immutable object with elements that replace the content ofobjectMarkingRefs. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of objectMarkingRefs elements to set- Returns:
- A modified copy of
thisobject
-
withGranularMarkings
Copy the current immutable object with elements that replace the content ofgranularMarkings.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withGranularMarkings
Copy the current immutable object with elements that replace the content ofgranularMarkings. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of granularMarkings elements to set- Returns:
- A modified copy of
thisobject
-
withHydrated
Copy the current immutable object by setting a value for thehydratedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hydrated- Returns:
- A modified copy of the
thisobject
-
withToJsonString
Copy the current immutable object by setting a value for thetoJsonStringattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for toJsonString (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofX509Certificatethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:isSelfSigned,hashes,version,serialNumber,signatureAlgorithm,issuer,validityNotBefore,validityNotAfter,subject,subjectPublicKeyAlgorithm,subjectPublicKeyModulus,subjectPublicKeyExponent,x509V3Extensions,id,type,extensions,observableObjectKey,defanged,customProperties,objectMarkingRefs,granularMarkings,hydrated,toJsonString. -
toString
Prints the immutable valueX509Certificatewith attribute values. -
copyOf
Creates an immutable copy of aX509CertificateCoovalue. 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 X509Certificate instance
-
builder
Creates a builder forX509Certificate.- Returns:
- A new X509Certificate builder
-