Package eu.europa.esig.dss.xades.tsl
Class AbstractTrustedListSignatureParametersBuilder
java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureParametersBuilder<XAdESSignatureParameters>
eu.europa.esig.dss.xades.tsl.AbstractTrustedListSignatureParametersBuilder
- All Implemented Interfaces:
SignatureParametersBuilder<XAdESSignatureParameters>
- Direct Known Subclasses:
TrustedListV5SignatureParametersBuilder
,TrustedListV6SignatureParametersBuilder
public abstract class AbstractTrustedListSignatureParametersBuilder
extends AbstractSignatureParametersBuilder<XAdESSignatureParameters>
This class contains common methods for signature parameters creation for an XML Trusted List signature
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractTrustedListSignatureParametersBuilder
(CertificateToken signingCertificate, DSSDocument tlXmlDocument) The constructor to build Signature Parameters for a Trusted List signing with respect to ETSI TS 119 612 -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method helps to determine whether the chosen signature parameters builders is applicable to the given document.build()
Creates a Signature Parameters instanceprotected DSSReference
Creates the enveloped-signature ds:Referenceprotected List
<DSSReference> Returns a list of ds:References to be incorporated within the signatureprotected abstract Integer
This method returns the target XML Trusted List version to be signedprotected XAdESSignatureParameters
Initialize and return empty signature parametersprotected abstract boolean
Gets whether the created XAdES signature shall be conformant to ETSI EN 319 132 standardsetReferenceDigestAlgorithm
(DigestAlgorithm digestAlgorithm) Sets an Enveloped ReferenceDigestAlgorithm
to usesetReferenceId
(String referenceId) Sets an Enveloped Reference Id to useMethods inherited from class eu.europa.esig.dss.signature.AbstractSignatureParametersBuilder
bLevel, setBLevelParams, setDigestAlgorithm, setEncryptionAlgorithm
-
Constructor Details
-
AbstractTrustedListSignatureParametersBuilder
protected AbstractTrustedListSignatureParametersBuilder(CertificateToken signingCertificate, DSSDocument tlXmlDocument) The constructor to build Signature Parameters for a Trusted List signing with respect to ETSI TS 119 612- Parameters:
signingCertificate
-CertificateToken
to be used for a signature creationtlXmlDocument
-DSSDocument
Trusted List XML document to be signed
-
-
Method Details
-
setReferenceId
Sets an Enveloped Reference Id to useDefault: "ref-enveloped-signature"
- Parameters:
referenceId
-String
reference Id- Returns:
- this builder
-
setReferenceDigestAlgorithm
public AbstractTrustedListSignatureParametersBuilder setReferenceDigestAlgorithm(DigestAlgorithm digestAlgorithm) Sets an Enveloped ReferenceDigestAlgorithm
to use- Parameters:
digestAlgorithm
-DigestAlgorithm
to be used- Returns:
- this builder
-
initParameters
Description copied from class:AbstractSignatureParametersBuilder
Initialize and return empty signature parameters- Specified by:
initParameters
in classAbstractSignatureParametersBuilder<XAdESSignatureParameters>
- Returns:
SP
signature parameters
-
build
Description copied from interface:SignatureParametersBuilder
Creates a Signature Parameters instance- Specified by:
build
in interfaceSignatureParametersBuilder<XAdESSignatureParameters>
- Overrides:
build
in classAbstractSignatureParametersBuilder<XAdESSignatureParameters>
- Returns:
SP
signature parameters
-
isEn319132
protected abstract boolean isEn319132()Gets whether the created XAdES signature shall be conformant to ETSI EN 319 132 standard- Returns:
- TRUE if the created signature shall be conformant to ETSI EN 319 132 standard (new XAdES), FALSE otherwise
-
getReferences
Returns a list of ds:References to be incorporated within the signature- Returns:
- a list of
DSSReference
s
-
getEnvelopedSignatureReference
Creates the enveloped-signature ds:Reference- Returns:
DSSReference
-
assertConfigurationIsValid
This method helps to determine whether the chosen signature parameters builders is applicable to the given document. Thus, it verifies whether the provided document representing the XML Trusted List is conformant to the definition and the target version. NOTE: this method requires 'dss-validation' module.- Throws:
IllegalInputException
- if the provided XML Trusted List has invalid structureDSSException
- is other error occurred during the processing
-
getTargetTLVersion
-