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
ConstructorsModifierConstructorDescriptionprotectedAbstractTrustedListSignatureParametersBuilder(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 TypeMethodDescriptionvoidThis method helps to determine whether the chosen signature parameters builders is applicable to the given document.build()Creates a Signature Parameters instanceprotected DSSReferenceCreates the enveloped-signature ds:Referenceprotected List<DSSReference> Returns a list of ds:References to be incorporated within the signatureprotected abstract IntegerThis method returns the target XML Trusted List version to be signedprotected XAdESSignatureParametersInitialize and return empty signature parametersprotected abstract booleanGets whether the created XAdES signature shall be conformant to ETSI EN 319 132 standardsetReferenceDigestAlgorithm(DigestAlgorithm digestAlgorithm) Sets an Enveloped ReferenceDigestAlgorithmto 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-CertificateTokento be used for a signature creationtlXmlDocument-DSSDocumentTrusted List XML document to be signed
-
-
Method Details
-
setReferenceId
Sets an Enveloped Reference Id to useDefault: "ref-enveloped-signature"
- Parameters:
referenceId-Stringreference Id- Returns:
- this builder
-
setReferenceDigestAlgorithm
public AbstractTrustedListSignatureParametersBuilder setReferenceDigestAlgorithm(DigestAlgorithm digestAlgorithm) Sets an Enveloped ReferenceDigestAlgorithmto use- Parameters:
digestAlgorithm-DigestAlgorithmto be used- Returns:
- this builder
-
initParameters
Description copied from class:AbstractSignatureParametersBuilderInitialize and return empty signature parameters- Specified by:
initParametersin classAbstractSignatureParametersBuilder<XAdESSignatureParameters>- Returns:
SPsignature parameters
-
build
Description copied from interface:SignatureParametersBuilderCreates a Signature Parameters instance- Specified by:
buildin interfaceSignatureParametersBuilder<XAdESSignatureParameters>- Overrides:
buildin classAbstractSignatureParametersBuilder<XAdESSignatureParameters>- Returns:
SPsignature 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
DSSReferences
-
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
This method returns the target XML Trusted List version to be signed- Returns:
Integer
-