Class X509Certificate.Builder
java.lang.Object
security.whisper.javastix.coo.objects.X509Certificate.Builder
- Enclosing class:
X509Certificate
Builds instances of type
X509Certificate.
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 Summary
Modifier and TypeMethodDescriptionfinal X509Certificate.BuilderaddAllExtensions(Iterable<? extends CyberObservableExtension> elements) Adds elements toextensionsset.final X509Certificate.BuilderaddAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.final X509Certificate.BuilderaddAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.final X509Certificate.BuilderaddExtension(CyberObservableExtension element) Adds one element toextensionsset.final X509Certificate.BuilderaddExtensions(CyberObservableExtension... elements) Adds elements toextensionsset.final X509Certificate.BuilderaddGranularMarking(GranularMarkingDm element) Adds one element togranularMarkingsset.final X509Certificate.BuilderaddGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.final X509Certificate.BuilderaddObjectMarkingRef(MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.final X509Certificate.BuilderaddObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.build()Builds a newX509Certificate.final X509Certificate.BuildercustomProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap.final X509Certificate.Builderdefanged(boolean defanged) Initializes the optional valuedefangedto defanged.final X509Certificate.BuilderInitializes the optional valuedefangedto defanged.final X509Certificate.Builderextensions(Iterable<? extends CyberObservableExtension> elements) Sets or replaces all elements forextensionsset.final X509Certificate.Builderfrom(BundleableObject instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.final X509Certificate.Builderfrom(StixCustomProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.final X509Certificate.Builderfrom(CyberObservableObjectCommonProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.CyberObservableObjectCommonPropertiesinstance.final X509Certificate.Builderfrom(X509CertificateCoo instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.objects.X509CertificateCooinstance.final X509Certificate.BuildergranularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.final X509Certificate.BuilderSets or replaces all mappings from the specified map as entries for thehashesmap.final X509Certificate.Builderhydrated(boolean hydrated) Initializes the value for thehydratedattribute.final X509Certificate.BuilderisSelfSigned(boolean isSelfSigned) Initializes the optional valueisSelfSignedto isSelfSigned.final X509Certificate.BuilderisSelfSigned(Optional<Boolean> isSelfSigned) Initializes the optional valueisSelfSignedto isSelfSigned.final X509Certificate.BuilderInitializes the optional valueissuerto issuer.final X509Certificate.BuilderInitializes the optional valueissuerto issuer.final X509Certificate.BuilderobjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.final X509Certificate.BuilderobservableObjectKey(String observableObjectKey) Initializes the value for theobservableObjectKeyattribute.final X509Certificate.BuilderputAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap.final X509Certificate.BuilderputAllHashes(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tohashesmap.final X509Certificate.BuilderputCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.final X509Certificate.BuilderputCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap.final X509Certificate.BuilderPut one entry to thehashesmap.final X509Certificate.BuilderPut one entry to thehashesmap.final X509Certificate.BuilderserialNumber(String serialNumber) Initializes the optional valueserialNumberto serialNumber.final X509Certificate.BuilderserialNumber(Optional<String> serialNumber) Initializes the optional valueserialNumberto serialNumber.final X509Certificate.BuildersignatureAlgorithm(String signatureAlgorithm) Initializes the optional valuesignatureAlgorithmto signatureAlgorithm.final X509Certificate.BuildersignatureAlgorithm(Optional<String> signatureAlgorithm) Initializes the optional valuesignatureAlgorithmto signatureAlgorithm.final X509Certificate.BuilderInitializes the optional valuesubjectto subject.final X509Certificate.BuilderInitializes the optional valuesubjectto subject.final X509Certificate.BuildersubjectPublicKeyAlgorithm(String subjectPublicKeyAlgorithm) Initializes the optional valuesubjectPublicKeyAlgorithmto subjectPublicKeyAlgorithm.final X509Certificate.BuildersubjectPublicKeyAlgorithm(Optional<String> subjectPublicKeyAlgorithm) Initializes the optional valuesubjectPublicKeyAlgorithmto subjectPublicKeyAlgorithm.final X509Certificate.BuildersubjectPublicKeyExponent(long subjectPublicKeyExponent) Initializes the optional valuesubjectPublicKeyExponentto subjectPublicKeyExponent.final X509Certificate.BuildersubjectPublicKeyExponent(Optional<Long> subjectPublicKeyExponent) Initializes the optional valuesubjectPublicKeyExponentto subjectPublicKeyExponent.final X509Certificate.BuildersubjectPublicKeyModulus(String subjectPublicKeyModulus) Initializes the optional valuesubjectPublicKeyModulusto subjectPublicKeyModulus.final X509Certificate.BuildersubjectPublicKeyModulus(Optional<String> subjectPublicKeyModulus) Initializes the optional valuesubjectPublicKeyModulusto subjectPublicKeyModulus.final X509Certificate.BuildertoJsonString(String toJsonString) Initializes the value for thetoJsonStringattribute.final X509Certificate.BuilderInitializes the value for thetypeattribute.final X509Certificate.BuildervalidityNotAfter(Optional<? extends StixInstant> validityNotAfter) Initializes the optional valuevalidityNotAfterto validityNotAfter.final X509Certificate.BuildervalidityNotAfter(StixInstant validityNotAfter) Initializes the optional valuevalidityNotAfterto validityNotAfter.final X509Certificate.BuildervalidityNotBefore(Optional<? extends StixInstant> validityNotBefore) Initializes the optional valuevalidityNotBeforeto validityNotBefore.final X509Certificate.BuildervalidityNotBefore(StixInstant validityNotBefore) Initializes the optional valuevalidityNotBeforeto validityNotBefore.final X509Certificate.BuilderInitializes the optional valueversionto version.final X509Certificate.BuilderInitializes the optional valueversionto version.final X509Certificate.Builderx509V3Extensions(Optional<? extends X509v3ExtensionsObj> x509V3Extensions) Initializes the optional valuex509V3Extensionsto x509V3Extensions.final X509Certificate.Builderx509V3Extensions(X509v3ExtensionsObj x509V3Extensions) Initializes the optional valuex509V3Extensionsto x509V3Extensions.
-
Method Details
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.bundle.BundleableObjectinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.common.StixCustomPropertiesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.objects.X509CertificateCooinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final X509Certificate.Builder from(CyberObservableObjectCommonProperties instance) Fill a builder with attribute values from the providedsecurity.whisper.javastix.coo.CyberObservableObjectCommonPropertiesinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
isSelfSigned
Initializes the optional valueisSelfSignedto isSelfSigned.- Parameters:
isSelfSigned- The value for isSelfSigned- Returns:
thisbuilder for chained invocation
-
isSelfSigned
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies whether the certificate is self-signed, i.e., whether it is signed by the same entity whose identity it certifies.") public final X509Certificate.Builder isSelfSigned(Optional<Boolean> isSelfSigned) Initializes the optional valueisSelfSignedto isSelfSigned.- Parameters:
isSelfSigned- The value for isSelfSigned- Returns:
thisbuilder for use in a chained invocation
-
putHash
Put one entry to thehashesmap.- Parameters:
key- The key in the hashes mapvalue- The associated value in the hashes map- Returns:
thisbuilder for use in a chained invocation
-
putHash
@CanIgnoreReturnValue public final X509Certificate.Builder putHash(Map.Entry<String, ? extends String> entry) Put one entry to thehashesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
hashes
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies any hashes that were calculated for the entire contents of the certificate.") public final X509Certificate.Builder hashes(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for thehashesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the hashes map- Returns:
thisbuilder for use in a chained invocation
-
putAllHashes
@CanIgnoreReturnValue public final X509Certificate.Builder putAllHashes(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tohashesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the hashes map- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the optional valueversionto version.- Parameters:
version- The value for version- Returns:
thisbuilder for chained invocation
-
version
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the version of the encoded certificate.") public final X509Certificate.Builder version(Optional<String> version) Initializes the optional valueversionto version.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
serialNumber
Initializes the optional valueserialNumberto serialNumber.- Parameters:
serialNumber- The value for serialNumber- Returns:
thisbuilder for chained invocation
-
serialNumber
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the unique identifier for the certificate, as issued by a specific Certificate Authority.") public final X509Certificate.Builder serialNumber(Optional<String> serialNumber) Initializes the optional valueserialNumberto serialNumber.- Parameters:
serialNumber- The value for serialNumber- Returns:
thisbuilder for use in a chained invocation
-
signatureAlgorithm
@CanIgnoreReturnValue public final X509Certificate.Builder signatureAlgorithm(String signatureAlgorithm) Initializes the optional valuesignatureAlgorithmto signatureAlgorithm.- Parameters:
signatureAlgorithm- The value for signatureAlgorithm- Returns:
thisbuilder for chained invocation
-
signatureAlgorithm
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the name of the algorithm used to sign the certificate.") public final X509Certificate.Builder signatureAlgorithm(Optional<String> signatureAlgorithm) Initializes the optional valuesignatureAlgorithmto signatureAlgorithm.- Parameters:
signatureAlgorithm- The value for signatureAlgorithm- Returns:
thisbuilder for use in a chained invocation
-
issuer
Initializes the optional valueissuerto issuer.- Parameters:
issuer- The value for issuer- Returns:
thisbuilder for chained invocation
-
issuer
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the name of the Certificate Authority that issued the certificate.") public final X509Certificate.Builder issuer(Optional<String> issuer) Initializes the optional valueissuerto issuer.- Parameters:
issuer- The value for issuer- Returns:
thisbuilder for use in a chained invocation
-
validityNotBefore
@CanIgnoreReturnValue public final X509Certificate.Builder validityNotBefore(StixInstant validityNotBefore) Initializes the optional valuevalidityNotBeforeto validityNotBefore.- Parameters:
validityNotBefore- The value for validityNotBefore- Returns:
thisbuilder for chained invocation
-
validityNotBefore
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date on which the certificate validity period begins.") public final X509Certificate.Builder validityNotBefore(Optional<? extends StixInstant> validityNotBefore) Initializes the optional valuevalidityNotBeforeto validityNotBefore.- Parameters:
validityNotBefore- The value for validityNotBefore- Returns:
thisbuilder for use in a chained invocation
-
validityNotAfter
@CanIgnoreReturnValue public final X509Certificate.Builder validityNotAfter(StixInstant validityNotAfter) Initializes the optional valuevalidityNotAfterto validityNotAfter.- Parameters:
validityNotAfter- The value for validityNotAfter- Returns:
thisbuilder for chained invocation
-
validityNotAfter
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the date on which the certificate validity period ends.") public final X509Certificate.Builder validityNotAfter(Optional<? extends StixInstant> validityNotAfter) Initializes the optional valuevalidityNotAfterto validityNotAfter.- Parameters:
validityNotAfter- The value for validityNotAfter- Returns:
thisbuilder for use in a chained invocation
-
subject
Initializes the optional valuesubjectto subject.- Parameters:
subject- The value for subject- Returns:
thisbuilder for chained invocation
-
subject
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the name of the entity associated with the public key stored in the subject public key field of the certificate.") public final X509Certificate.Builder subject(Optional<String> subject) Initializes the optional valuesubjectto subject.- Parameters:
subject- The value for subject- Returns:
thisbuilder for use in a chained invocation
-
subjectPublicKeyAlgorithm
@CanIgnoreReturnValue public final X509Certificate.Builder subjectPublicKeyAlgorithm(String subjectPublicKeyAlgorithm) Initializes the optional valuesubjectPublicKeyAlgorithmto subjectPublicKeyAlgorithm.- Parameters:
subjectPublicKeyAlgorithm- The value for subjectPublicKeyAlgorithm- Returns:
thisbuilder for chained invocation
-
subjectPublicKeyAlgorithm
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the name of the algorithm with which to encrypt data being sent to the subject.") public final X509Certificate.Builder subjectPublicKeyAlgorithm(Optional<String> subjectPublicKeyAlgorithm) Initializes the optional valuesubjectPublicKeyAlgorithmto subjectPublicKeyAlgorithm.- Parameters:
subjectPublicKeyAlgorithm- The value for subjectPublicKeyAlgorithm- Returns:
thisbuilder for use in a chained invocation
-
subjectPublicKeyModulus
@CanIgnoreReturnValue public final X509Certificate.Builder subjectPublicKeyModulus(String subjectPublicKeyModulus) Initializes the optional valuesubjectPublicKeyModulusto subjectPublicKeyModulus.- Parameters:
subjectPublicKeyModulus- The value for subjectPublicKeyModulus- Returns:
thisbuilder for chained invocation
-
subjectPublicKeyModulus
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the modulus portion of the subject\u2019s public RSA key.") public final X509Certificate.Builder subjectPublicKeyModulus(Optional<String> subjectPublicKeyModulus) Initializes the optional valuesubjectPublicKeyModulusto subjectPublicKeyModulus.- Parameters:
subjectPublicKeyModulus- The value for subjectPublicKeyModulus- Returns:
thisbuilder for use in a chained invocation
-
subjectPublicKeyExponent
@CanIgnoreReturnValue public final X509Certificate.Builder subjectPublicKeyExponent(long subjectPublicKeyExponent) Initializes the optional valuesubjectPublicKeyExponentto subjectPublicKeyExponent.- Parameters:
subjectPublicKeyExponent- The value for subjectPublicKeyExponent- Returns:
thisbuilder for chained invocation
-
subjectPublicKeyExponent
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies the exponent portion of the subject\u2019s public RSA key, as an integer.") public final X509Certificate.Builder subjectPublicKeyExponent(Optional<Long> subjectPublicKeyExponent) Initializes the optional valuesubjectPublicKeyExponentto subjectPublicKeyExponent.- Parameters:
subjectPublicKeyExponent- The value for subjectPublicKeyExponent- Returns:
thisbuilder for use in a chained invocation
-
x509V3Extensions
@CanIgnoreReturnValue public final X509Certificate.Builder x509V3Extensions(X509v3ExtensionsObj x509V3Extensions) Initializes the optional valuex509V3Extensionsto x509V3Extensions.- Parameters:
x509V3Extensions- The value for x509V3Extensions- Returns:
thisbuilder for chained invocation
-
x509V3Extensions
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies any standard X.509 v3 extensions that may be used in the certificate.") public final X509Certificate.Builder x509V3Extensions(Optional<? extends X509v3ExtensionsObj> x509V3Extensions) Initializes the optional valuex509V3Extensionsto x509V3Extensions.- Parameters:
x509V3Extensions- The value for x509V3Extensions- Returns:
thisbuilder for use in a chained invocation
-
type
Initializes the value for thetypeattribute.- Parameters:
type- The value for type (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addExtension
@CanIgnoreReturnValue public final X509Certificate.Builder addExtension(@Nullable CyberObservableExtension element) Adds one element toextensionsset.- Parameters:
element- A extensions element- Returns:
thisbuilder for use in a chained invocation
-
addExtensions
@CanIgnoreReturnValue public final X509Certificate.Builder addExtensions(CyberObservableExtension... elements) Adds elements toextensionsset.- Parameters:
elements- An array of extensions elements- Returns:
thisbuilder for use in a chained invocation
-
extensions
@CanIgnoreReturnValue @JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public final X509Certificate.Builder extensions(Iterable<? extends CyberObservableExtension> elements) Sets or replaces all elements forextensionsset.- Parameters:
elements- An iterable of extensions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExtensions
@CanIgnoreReturnValue public final X509Certificate.Builder addAllExtensions(Iterable<? extends CyberObservableExtension> elements) Adds elements toextensionsset.- Parameters:
elements- An iterable of extensions elements- Returns:
thisbuilder for use in a chained invocation
-
observableObjectKey
@CanIgnoreReturnValue public final X509Certificate.Builder observableObjectKey(String observableObjectKey) Initializes the value for theobservableObjectKeyattribute.If not set, this attribute will have a default value as returned by the initializer of
observableObjectKey.- Parameters:
observableObjectKey- The value for observableObjectKey- Returns:
thisbuilder for use in a chained invocation
-
defanged
Initializes the optional valuedefangedto defanged.- Parameters:
defanged- The value for defanged- Returns:
thisbuilder for chained invocation
-
defanged
@CanIgnoreReturnValue @JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public final X509Certificate.Builder defanged(Optional<Boolean> defanged) Initializes the optional valuedefangedto defanged.- Parameters:
defanged- The value for defanged- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final X509Certificate.Builder putCustomProperty(String key, Object value) Put one entry to thecustomPropertiesmap.- Parameters:
key- The key in the customProperties mapvalue- The associated value in the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
putCustomProperty
@CanIgnoreReturnValue public final X509Certificate.Builder putCustomProperty(Map.Entry<String, ? extends Object> entry) Put one entry to thecustomPropertiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
customProperties
@CanIgnoreReturnValue public final X509Certificate.Builder customProperties(Map<String, ? extends Object> entries) Sets or replaces all mappings from the specified map as entries for thecustomPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
putAllCustomProperties
@CanIgnoreReturnValue public final X509Certificate.Builder putAllCustomProperties(Map<String, ? extends Object> entries) Put all mappings from the specified map as entries tocustomPropertiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the customProperties map- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRef
@CanIgnoreReturnValue public final X509Certificate.Builder addObjectMarkingRef(@Nullable MarkingDefinitionDm element) Adds one element toobjectMarkingRefsset.- Parameters:
element- A objectMarkingRefs element- Returns:
thisbuilder for use in a chained invocation
-
addObjectMarkingRefs
@CanIgnoreReturnValue public final X509Certificate.Builder addObjectMarkingRefs(MarkingDefinitionDm... elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An array of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
objectMarkingRefs
@CanIgnoreReturnValue public final X509Certificate.Builder objectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Sets or replaces all elements forobjectMarkingRefsset.- Parameters:
elements- An iterable of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addAllObjectMarkingRefs
@CanIgnoreReturnValue public final X509Certificate.Builder addAllObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Adds elements toobjectMarkingRefsset.- Parameters:
elements- An iterable of objectMarkingRefs elements- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarking
@CanIgnoreReturnValue public final X509Certificate.Builder addGranularMarking(@Nullable GranularMarkingDm element) Adds one element togranularMarkingsset.- Parameters:
element- A granularMarkings element- Returns:
thisbuilder for use in a chained invocation
-
addGranularMarkings
@CanIgnoreReturnValue public final X509Certificate.Builder addGranularMarkings(GranularMarkingDm... elements) Adds elements togranularMarkingsset.- Parameters:
elements- An array of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
granularMarkings
@CanIgnoreReturnValue public final X509Certificate.Builder granularMarkings(Iterable<? extends GranularMarkingDm> elements) Sets or replaces all elements forgranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
addAllGranularMarkings
@CanIgnoreReturnValue public final X509Certificate.Builder addAllGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Adds elements togranularMarkingsset.- Parameters:
elements- An iterable of granularMarkings elements- Returns:
thisbuilder for use in a chained invocation
-
hydrated
Initializes the value for thehydratedattribute.- Parameters:
hydrated- The value for hydrated- Returns:
thisbuilder for use in a chained invocation
-
toJsonString
Initializes the value for thetoJsonStringattribute.- Parameters:
toJsonString- The value for toJsonString (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newX509Certificate.- Returns:
- An immutable instance of X509Certificate
- Throws:
IllegalStateException- if any required attributes are missing
-