Package eu.europa.esig.dss.jades
Class JAdESSignatureParameters
java.lang.Object
eu.europa.esig.dss.model.AbstractSerializableSignatureParameters<TP>
eu.europa.esig.dss.AbstractSignatureParameters<JAdESTimestampParameters>
eu.europa.esig.dss.jades.JAdESSignatureParameters
- All Implemented Interfaces:
SerializableSignatureParameters
,Serializable
- Direct Known Subclasses:
JAdESCounterSignatureParameters
The parameters to create/extend a JAdES signature
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.AbstractSignatureParameters
context
Fields inherited from class eu.europa.esig.dss.model.AbstractSerializableSignatureParameters
archiveTimestampParameters, contentTimestampParameters, signatureTimestampParameters
-
Constructor Summary
ConstructorDescriptionDefault constructor instantiating object with default parameters -
Method Summary
Modifier and TypeMethodDescriptionGet the parameters for archive timestamp (Baseline-LTA)Get the parameters for content timestamp (Baseline-B)Gets JWSSerializationTypeReturns a SigDMechanism to useGet the parameters for signature timestamp (Baseline-T)boolean
Gets if the instances of the 'etsiU' unprotected header shall appear in their corresponding base64url encoding Default : TRUE (base64Url encoded etsiU components will be used)boolean
Gets if base64Url encoded payload shall be usedboolean
Defines if complete certificate chain binaries must be included into the signed header ('x5c' attribute)boolean
Returns whether a 'kid' (key identifier) header parameter should be createdboolean
Defines if the signature MimeType string must be included into the signed header ('typ' attribute)void
setBase64UrlEncodedEtsiUComponents
(boolean base64UrlEncodedEtsiUComponents) Sets if the instances of the 'etsiU' header shall appear in their corresponding base64url encoding.void
setBase64UrlEncodedPayload
(boolean base64EncodedPayload) Sets if base64Url encoded payload shall be used If FALSE, the unencoded (original) payload will be used according to RFC 7797 NOTE: some restrictions for payload content can apply when dealing with unencoded payload.void
setIncludeCertificateChain
(boolean includeCertificateChain) Sets if complete certificate chain binaries must be included into the signed header Default: TRUE (the complete binaries will be included into the signed header)void
setIncludeKeyIdentifier
(boolean includeKeyIdentifier) Sets whether a 'kid' (key identifier) header parameter should be created within a protected header, provided that a signing-certificate is defined within the signature parameters.void
setIncludeSignatureType
(boolean includeSignatureType) Sets if the signature MimeType string must be included into the signed header ('typ' attribute) Default: TRUE (the signature MimeType will be included into the signed header)void
setJwsSerializationType
(JWSSerializationType jwsSerializationType) Sets the JWSSerializationType Default: JWSSerializationType.COMPACT_SERIALIZATIONvoid
setSigDMechanism
(SigDMechanism sigDMechanism) Sets SigDMechanism to use for a Detached signaturevoid
setSignatureLevel
(SignatureLevel signatureLevel) Set signature level.void
setSigningCertificateDigestMethod
(DigestAlgorithm signingCertificateDigestMethod) The digest method indicates the digest algorithm to be used to calculate the certificate digest to define a signing certificate ('x5t#256' for SHA256 or 'x5t#o' for other algorithms) Default: DigestAlgorithm.SHA256 ('x5t#256' attribute will be created)Methods inherited from class eu.europa.esig.dss.AbstractSignatureParameters
getCertificateChain, getContentTimestamps, getContext, getDetachedContents, getDeterministicId, getSignedData, getSigningCertificate, reinit, setCertificateChain, setCertificateChain, setContentTimestamps, setDetachedContents, setSignedData, setSigningCertificate
Methods inherited from class eu.europa.esig.dss.model.AbstractSerializableSignatureParameters
bLevel, equals, getDigestAlgorithm, getEncryptionAlgorithm, getMaskGenerationFunction, getReferenceDigestAlgorithm, getSignatureAlgorithm, getSignatureLevel, getSignaturePackaging, hashCode, isCheckCertificateRevocation, isGenerateTBSWithoutCertificate, isSignWithExpiredCertificate, isSignWithNotYetValidCertificate, setArchiveTimestampParameters, setBLevelParams, setCheckCertificateRevocation, setContentTimestampParameters, setDigestAlgorithm, setEncryptionAlgorithm, setGenerateTBSWithoutCertificate, setMaskGenerationFunction, setReferenceDigestAlgorithm, setSignaturePackaging, setSignatureTimestampParameters, setSignWithExpiredCertificate, setSignWithNotYetValidCertificate, toString
-
Constructor Details
-
JAdESSignatureParameters
public JAdESSignatureParameters()Default constructor instantiating object with default parameters
-
-
Method Details
-
setSignatureLevel
Description copied from class:AbstractSerializableSignatureParameters
Set signature level. This field cannot be null.- Overrides:
setSignatureLevel
in classAbstractSerializableSignatureParameters<JAdESTimestampParameters>
- Parameters:
signatureLevel
- the expected signature level
-
getContentTimestampParameters
Description copied from class:AbstractSerializableSignatureParameters
Get the parameters for content timestamp (Baseline-B)- Overrides:
getContentTimestampParameters
in classAbstractSerializableSignatureParameters<JAdESTimestampParameters>
- Returns:
- the parameters to produce a content timestamp
-
getSignatureTimestampParameters
Description copied from class:AbstractSerializableSignatureParameters
Get the parameters for signature timestamp (Baseline-T)- Overrides:
getSignatureTimestampParameters
in classAbstractSerializableSignatureParameters<JAdESTimestampParameters>
- Returns:
- the parameters to produce a signature timestamp
-
getArchiveTimestampParameters
Description copied from class:AbstractSerializableSignatureParameters
Get the parameters for archive timestamp (Baseline-LTA)- Overrides:
getArchiveTimestampParameters
in classAbstractSerializableSignatureParameters<JAdESTimestampParameters>
- Returns:
- the parameters to produce an archive timestamp
-
isIncludeCertificateChain
public boolean isIncludeCertificateChain()Defines if complete certificate chain binaries must be included into the signed header ('x5c' attribute)- Returns:
- TRUE if the certificate chain must be included, FALSE otherwise
-
setIncludeCertificateChain
public void setIncludeCertificateChain(boolean includeCertificateChain) Sets if complete certificate chain binaries must be included into the signed header Default: TRUE (the complete binaries will be included into the signed header)- Parameters:
includeCertificateChain
- if the certificate chain binaries must be included into the signed header
-
isIncludeSignatureType
public boolean isIncludeSignatureType()Defines if the signature MimeType string must be included into the signed header ('typ' attribute)- Returns:
- TRUE if the MimeType string of the produced signature must be included, FALSE otherwise
-
setIncludeSignatureType
public void setIncludeSignatureType(boolean includeSignatureType) Sets if the signature MimeType string must be included into the signed header ('typ' attribute) Default: TRUE (the signature MimeType will be included into the signed header)- Parameters:
includeSignatureType
- if the signature MimeType be included into the signed header
-
isIncludeKeyIdentifier
public boolean isIncludeKeyIdentifier()Returns whether a 'kid' (key identifier) header parameter should be created- Returns:
- TRUE if the 'kid' should be created, FALSE otherwise
-
setIncludeKeyIdentifier
public void setIncludeKeyIdentifier(boolean includeKeyIdentifier) Sets whether a 'kid' (key identifier) header parameter should be created within a protected header, provided that a signing-certificate is defined within the signature parameters. DEFAULT : TRUE (the 'kid' header parameter is created)- Parameters:
includeKeyIdentifier
- identifies whether 'kid' should be created (when a signing-certificate is provided)
-
getSigningCertificateDigestMethod
- Returns:
DigestAlgorithm
to be used for signing certificate digest representation
-
setSigningCertificateDigestMethod
The digest method indicates the digest algorithm to be used to calculate the certificate digest to define a signing certificate ('x5t#256' for SHA256 or 'x5t#o' for other algorithms) Default: DigestAlgorithm.SHA256 ('x5t#256' attribute will be created)- Parameters:
signingCertificateDigestMethod
-DigestAlgorithm
to be used
-
getJwsSerializationType
Gets JWSSerializationType- Returns:
JWSSerializationType
-
setJwsSerializationType
Sets the JWSSerializationType Default: JWSSerializationType.COMPACT_SERIALIZATION- Parameters:
jwsSerializationType
-JWSSerializationType
-
getSigDMechanism
Returns a SigDMechanism to use- Returns:
SigDMechanism
-
setSigDMechanism
Sets SigDMechanism to use for a Detached signature- Parameters:
sigDMechanism
-SigDMechanism
-
isBase64UrlEncodedPayload
public boolean isBase64UrlEncodedPayload()Gets if base64Url encoded payload shall be used- Returns:
- TRUE if to use base64url encoded payload, FALSE otherwise
-
setBase64UrlEncodedPayload
public void setBase64UrlEncodedPayload(boolean base64EncodedPayload) Sets if base64Url encoded payload shall be used If FALSE, the unencoded (original) payload will be used according to RFC 7797 NOTE: some restrictions for payload content can apply when dealing with unencoded payload. For more information please see RFC 7797. The parameter is independent frombase64UrlEncodedEtsiUComponents
Default : TRUE (base64Url encoded payload will be used)- Parameters:
base64EncodedPayload
- true if the payload shall be present in its corresponding base64url encoding, FALSE otherwise
-
isBase64UrlEncodedEtsiUComponents
public boolean isBase64UrlEncodedEtsiUComponents()Gets if the instances of the 'etsiU' unprotected header shall appear in their corresponding base64url encoding Default : TRUE (base64Url encoded etsiU components will be used)- Returns:
- TRUE if the components of 'etsiU' header shall appear in their corresponding base64url encoding, otherwise in their clear JSON incorporation
-
setBase64UrlEncodedEtsiUComponents
public void setBase64UrlEncodedEtsiUComponents(boolean base64UrlEncodedEtsiUComponents) Sets if the instances of the 'etsiU' header shall appear in their corresponding base64url encoding. If FALSE the components of 'etsiU' will appear in their clear JSON incorporation. The parameter is used for Serialization (or Flattened) format only with unsigned properties. NOTE: the parameter is independent frombase64UrlEncodedPayload
Default : TRUE (base64url encoded etsiU components)- Parameters:
base64UrlEncodedEtsiUComponents
- if the components of 'etsiU' unsigned header shall appear in their corresponding base64url encoding, if FALSE the components will appear in their clear JSON incorporation
-