Class XAdESService
java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>
eu.europa.esig.dss.xades.signature.XAdESService
- All Implemented Interfaces:
DocumentSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>,MultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>,Serializable
public class XAdESService extends AbstractSignatureService<XAdESSignatureParameters,XAdESTimestampParameters> implements MultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>
XAdES implementation of DocumentSignatureService
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
certificateVerifier, tspSource -
Constructor Summary
Constructors Constructor Description XAdESService(CertificateVerifier certificateVerifier)This is the constructor to create an instance of theXAdESService. -
Method Summary
Modifier and Type Method Description DSSDocumentextendDocument(DSSDocument toExtendDocument, XAdESSignatureParameters parameters)Extends the level of the signatures in thetoExtendDocumentTimestampTokengetContentTimestamp(DSSDocument toSignDocument, XAdESSignatureParameters parameters)This method allows to compute a content-timestamp (which is added in the signed properties)TimestampTokengetContentTimestamp(List<DSSDocument> toSignDocuments, XAdESSignatureParameters parameters)Creates a content-timestamp attribute (to be include in the signed-data)ToBeSignedgetDataToSign(DSSDocument toSignDocument, XAdESSignatureParameters parameters)Retrieves the bytes of the data that need to be signed based on thetoSignDocumentandparameters.ToBeSignedgetDataToSign(List<DSSDocument> toSignDocuments, XAdESSignatureParameters parameters)Retrieves the bytes of the data that need to be signed based on thetoSignDocumentsandparameters.DSSDocumentsignDocument(DSSDocument toSignDocument, XAdESSignatureParameters parameters, SignatureValue signatureValue)Signs the toSignDocument with the provided signatureValue.DSSDocumentsignDocument(List<DSSDocument> toSignDocuments, XAdESSignatureParameters parameters, SignatureValue signatureValue)Signs the toSignDocuments with the provided signatureValue.DSSDocumenttimestamp(List<DSSDocument> toTimestampDocuments, XAdESTimestampParameters parameters)Timestamps the toSignDocuments with the provided signatureValue.Methods inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
assertSigningDateInCertificateValidityRange, getFinalArchiveName, getFinalFileName, setTspSource, timestamp
-
Constructor Details
-
XAdESService
This is the constructor to create an instance of theXAdESService. A certificate verifier must be provided.- Parameters:
certificateVerifier-CertificateVerifierprovides information on the sources to be used in the validation process in the context of a signature.
-
-
Method Details
-
getContentTimestamp
public TimestampToken getContentTimestamp(DSSDocument toSignDocument, XAdESSignatureParameters parameters)Description copied from interface:DocumentSignatureServiceThis method allows to compute a content-timestamp (which is added in the signed properties)- Specified by:
getContentTimestampin interfaceDocumentSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toSignDocument- document to sign or the already existing signatureparameters- set of the driving signing parameters- Returns:
- a timestamp token
-
getContentTimestamp
public TimestampToken getContentTimestamp(List<DSSDocument> toSignDocuments, XAdESSignatureParameters parameters)Description copied from interface:MultipleDocumentsSignatureServiceCreates a content-timestamp attribute (to be include in the signed-data)- Specified by:
getContentTimestampin interfaceMultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toSignDocuments- list of documents to signparameters- set of the driving signing parameters- Returns:
- a timestamp token
-
getDataToSign
public ToBeSigned getDataToSign(DSSDocument toSignDocument, XAdESSignatureParameters parameters) throws DSSExceptionDescription copied from interface:DocumentSignatureServiceRetrieves the bytes of the data that need to be signed based on thetoSignDocumentandparameters. WhentoSignDocumentcontains an already existing signature the returned bytes are related to a new parallel signature. - Enveloped signature (XML): a new signature is added and the signed data corresponds to that pointed by the first signature; - Enveloping signature: - - XML: The parallel signature is not possible - - CMS: A new parallel signature is added - Detached signature: - - XML: The parallel signature is added - - CMS: A new parallel signature is added- Specified by:
getDataToSignin interfaceDocumentSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toSignDocument- document to sign or the already existing signatureparameters- set of the driving signing parameters- Returns:
- the data to be signed
- Throws:
DSSException
-
getDataToSign
public ToBeSigned getDataToSign(List<DSSDocument> toSignDocuments, XAdESSignatureParameters parameters) throws DSSExceptionDescription copied from interface:MultipleDocumentsSignatureServiceRetrieves the bytes of the data that need to be signed based on thetoSignDocumentsandparameters. WhentoSignDocumentscontains an already existing signature the returned bytes are related to a new parallel signature.- Specified by:
getDataToSignin interfaceMultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toSignDocuments- list of documents to signparameters- set of the driving signing parameters- Returns:
- the data to be signed
- Throws:
DSSException
-
signDocument
public DSSDocument signDocument(DSSDocument toSignDocument, XAdESSignatureParameters parameters, SignatureValue signatureValue) throws DSSExceptionDescription copied from interface:DocumentSignatureServiceSigns the toSignDocument with the provided signatureValue.- Specified by:
signDocumentin interfaceDocumentSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toSignDocument- document to signparameters- set of the driving signing parameterssignatureValue- the signature value to incorporate- Returns:
- the signed document (
toSignDocumentwith the incorporated signature or the detached signature) - Throws:
DSSException
-
signDocument
public DSSDocument signDocument(List<DSSDocument> toSignDocuments, XAdESSignatureParameters parameters, SignatureValue signatureValue) throws DSSExceptionDescription copied from interface:MultipleDocumentsSignatureServiceSigns the toSignDocuments with the provided signatureValue.- Specified by:
signDocumentin interfaceMultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toSignDocuments- list of documents to signparameters- set of the driving signing parameterssignatureValue- the signature value to incorporate- Returns:
- the container with the signature and the documents (ASiC) or the signature file
- Throws:
DSSException
-
extendDocument
public DSSDocument extendDocument(DSSDocument toExtendDocument, XAdESSignatureParameters parameters) throws DSSExceptionDescription copied from interface:MultipleDocumentsSignatureServiceExtends the level of the signatures in thetoExtendDocument- Specified by:
extendDocumentin interfaceDocumentSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Specified by:
extendDocumentin interfaceMultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toExtendDocument- document to extendparameters- set of the driving signing parameters- Returns:
- the extended signature
- Throws:
DSSException
-
timestamp
public DSSDocument timestamp(List<DSSDocument> toTimestampDocuments, XAdESTimestampParameters parameters)Description copied from interface:MultipleDocumentsSignatureServiceTimestamps the toSignDocuments with the provided signatureValue.- Specified by:
timestampin interfaceMultipleDocumentsSignatureService<XAdESSignatureParameters,XAdESTimestampParameters>- Parameters:
toTimestampDocuments- list of documents to timestampparameters- set of the driving timestamping parameters- Returns:
- the container with the added timestamp token
-