Class ASiCWithXAdESService
java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<SP,TP>
eu.europa.esig.dss.asic.common.signature.AbstractASiCSignatureService<ASiCWithXAdESSignatureParameters,XAdESTimestampParameters,XAdESCounterSignatureParameters>
eu.europa.esig.dss.asic.xades.signature.ASiCWithXAdESService
- All Implemented Interfaces:
CounterSignatureService<XAdESCounterSignatureParameters>,DocumentSignatureService<ASiCWithXAdESSignatureParameters,XAdESTimestampParameters>,MultipleDocumentsSignatureService<ASiCWithXAdESSignatureParameters,XAdESTimestampParameters>,Serializable
public class ASiCWithXAdESService extends AbstractASiCSignatureService<ASiCWithXAdESSignatureParameters,XAdESTimestampParameters,XAdESCounterSignatureParameters>
The service containing the main methods for ASiC with XAdES signature creation/extension
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.asic.common.signature.AbstractASiCSignatureService
archiveContentFields inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
certificateVerifier, tspSource -
Constructor Summary
Constructors Constructor Description ASiCWithXAdESService(CertificateVerifier certificateVerifier)The default constructor to instantiate the service -
Method Summary
Modifier and Type Method Description DSSDocumentaddSignaturePolicyStore(DSSDocument asicContainer, SignaturePolicyStore signaturePolicyStore)Incorporates a Signature Policy Store as an unsigned property into the ASiC with XAdES SignatureDSSDocumentcounterSignSignature(DSSDocument asicContainer, XAdESCounterSignatureParameters parameters, SignatureValue signatureValue)Counter signs thesignatureDocumentwith the provided signatureValue.DSSDocumentextendDocument(DSSDocument toExtendDocument, ASiCWithXAdESSignatureParameters parameters)Extends the level of the signatures in thetoExtendDocumentprotected AbstractASiCContainerExtractorgetArchiveExtractor(DSSDocument archive)Returns a relevant ASiC container extractor for the given formatTimestampTokengetContentTimestamp(List<DSSDocument> toSignDocuments, ASiCWithXAdESSignatureParameters parameters)Creates a content-timestamp attribute (to be include in the signed-data)ToBeSignedgetDataToBeCounterSigned(DSSDocument asicContainer, XAdESCounterSignatureParameters parameters)Retrieves the bytes of the data that need to be counter signed fromsignatureDocument.ToBeSignedgetDataToSign(List<DSSDocument> toSignDocuments, ASiCWithXAdESSignatureParameters parameters)Retrieves the bytes of the data that need to be signed based on thetoSignDocumentsandparameters.protected StringgetExpectedSignatureExtension()Returns the relevant signature document extension for the implemented formatDSSDocumentsignDocument(List<DSSDocument> toSignDocuments, ASiCWithXAdESSignatureParameters 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.asic.common.signature.AbstractASiCSignatureService
assertAddSignaturePolicyStorePossible, assertCounterSignatureParametersValid, buildASiCContainer, extractCurrentArchive, getContentTimestamp, getDataToSign, getEmbeddedArchiveManifests, getEmbeddedManifests, getEmbeddedMimetype, getEmbeddedSignatures, getEmbeddedSignedDocuments, getEmbeddedTimestamps, getFinalArchiveName, mergeArchiveAndExtendedSignatures, signDocument, timestampMethods inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
assertSigningDateInCertificateValidityRange, getFinalDocumentName, getFinalFileName, getFinalFileName, isValidSignatureValue, setTspSourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.europa.esig.dss.signature.MultipleDocumentsSignatureService
isValidSignatureValue
-
Constructor Details
-
ASiCWithXAdESService
The default constructor to instantiate the service- Parameters:
certificateVerifier-CertificateVerifierto use
-
-
Method Details
-
getContentTimestamp
public TimestampToken getContentTimestamp(List<DSSDocument> toSignDocuments, ASiCWithXAdESSignatureParameters parameters)Description copied from interface:MultipleDocumentsSignatureServiceCreates a content-timestamp attribute (to be include in the signed-data)- Parameters:
toSignDocuments- list of documents to signparameters- set of the driving signing parameters- Returns:
- a timestamp token
-
getDataToSign
public ToBeSigned getDataToSign(List<DSSDocument> toSignDocuments, ASiCWithXAdESSignatureParameters parameters)Description 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.- Parameters:
toSignDocuments- list of documents to signparameters- set of the driving signing parameters- Returns:
- the data to be signed
-
signDocument
public DSSDocument signDocument(List<DSSDocument> toSignDocuments, ASiCWithXAdESSignatureParameters parameters, SignatureValue signatureValue)Description copied from interface:MultipleDocumentsSignatureServiceSigns the toSignDocuments with the provided signatureValue.- 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
-
timestamp
public DSSDocument timestamp(List<DSSDocument> toTimestampDocuments, XAdESTimestampParameters parameters)Description copied from interface:MultipleDocumentsSignatureServiceTimestamps the toSignDocuments with the provided signatureValue.- Parameters:
toTimestampDocuments- list of documents to timestampparameters- set of the driving timestamping parameters- Returns:
- the container with the added timestamp token
-
extendDocument
public DSSDocument extendDocument(DSSDocument toExtendDocument, ASiCWithXAdESSignatureParameters parameters)Description copied from interface:MultipleDocumentsSignatureServiceExtends the level of the signatures in thetoExtendDocument- Parameters:
toExtendDocument- document to extendparameters- set of the driving signing parameters- Returns:
- the extended signature
-
getArchiveExtractor
Description copied from class:AbstractASiCSignatureServiceReturns a relevant ASiC container extractor for the given format- Specified by:
getArchiveExtractorin classAbstractASiCSignatureService<ASiCWithXAdESSignatureParameters,XAdESTimestampParameters,XAdESCounterSignatureParameters>- Parameters:
archive-DSSDocumentto get an extractor for- Returns:
- an instance of
AbstractASiCContainerExtractor
-
getExpectedSignatureExtension
Description copied from class:AbstractASiCSignatureServiceReturns the relevant signature document extension for the implemented format- Specified by:
getExpectedSignatureExtensionin classAbstractASiCSignatureService<ASiCWithXAdESSignatureParameters,XAdESTimestampParameters,XAdESCounterSignatureParameters>- Returns:
Stringsignature extension
-
addSignaturePolicyStore
public DSSDocument addSignaturePolicyStore(DSSDocument asicContainer, SignaturePolicyStore signaturePolicyStore)Incorporates a Signature Policy Store as an unsigned property into the ASiC with XAdES Signature- Parameters:
asicContainer-DSSDocumentcontaining a XAdES Signature to add a SignaturePolicyStore tosignaturePolicyStore-SignaturePolicyStoreto add- Returns:
DSSDocumentASiC with XAdES container with an incorporated SignaturePolicyStore
-
getDataToBeCounterSigned
public ToBeSigned getDataToBeCounterSigned(DSSDocument asicContainer, XAdESCounterSignatureParameters parameters)Description copied from interface:CounterSignatureServiceRetrieves the bytes of the data that need to be counter signed fromsignatureDocument.signatureDocumentshall be a valid signature of the same type- Parameters:
asicContainer-DSSDocumentrepresenting the original signature to be counter signedparameters- set of the driving signing parameters for a counter signature- Returns:
ToBeSignedto be counter signed byte array (signature value retrieved from thesignatureDocument)
-
counterSignSignature
public DSSDocument counterSignSignature(DSSDocument asicContainer, XAdESCounterSignatureParameters parameters, SignatureValue signatureValue)Description copied from interface:CounterSignatureServiceCounter signs thesignatureDocumentwith the provided signatureValue.- Parameters:
asicContainer-DSSDocumentto be counter signedparameters- set of the driving signing parameters for a counter signaturesignatureValue-SignatureValuethe signature value to incorporate- Returns:
DSSDocumentthe signature document enveloping a newly created counter signature
-