Class AbstractASiCSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<SP,TP>
eu.europa.esig.dss.asic.common.signature.AbstractASiCSignatureService<SP,TP>
- All Implemented Interfaces:
DocumentSignatureService<SP,TP>
,MultipleDocumentsSignatureService<SP,TP>
,Serializable
- Direct Known Subclasses:
ASiCWithCAdESService
,ASiCWithXAdESService
public abstract class AbstractASiCSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters> extends AbstractSignatureService<SP,TP> implements MultipleDocumentsSignatureService<SP,TP>
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected ASiCExtractResult
archiveContent
Fields inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
certificateVerifier, tspSource
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractASiCSignatureService(CertificateVerifier certificateVerifier)
-
Method Summary
Modifier and Type Method Description protected DSSDocument
buildASiCContainer(List<DSSDocument> documentsToBeSigned, List<DSSDocument> signatures, List<DSSDocument> documentsToStore, ASiCParameters asicParameters, DSSDocument rootContainer)
protected void
extractCurrentArchive(DSSDocument archive)
protected abstract AbstractASiCContainerExtractor
getArchiveExtractor(DSSDocument archive)
TimestampToken
getContentTimestamp(DSSDocument toSignDocument, SP parameters)
This method allows to compute a content-timestamp (which is added in the signed properties)ToBeSigned
getDataToSign(DSSDocument toSignDocument, SP parameters)
Retrieves the bytes of the data that need to be signed based on thetoSignDocument
andparameters
.protected List<DSSDocument>
getEmbeddedArchiveManifests()
protected List<DSSDocument>
getEmbeddedManifests()
protected DSSDocument
getEmbeddedMimetype()
protected List<DSSDocument>
getEmbeddedSignatures()
protected List<DSSDocument>
getEmbeddedSignedDocuments()
protected List<DSSDocument>
getEmbeddedTimestamps()
protected abstract String
getExpectedSignatureExtension()
protected abstract boolean
isSignatureFilename(String name)
protected DSSDocument
mergeArchiveAndExtendedSignatures(DSSDocument archiveDocument, List<DSSDocument> signaturesToAdd)
DSSDocument
signDocument(DSSDocument toSignDocument, SP parameters, SignatureValue signatureValue)
Signs the toSignDocument with the provided signatureValue.protected void
storeZipComment(ASiCParameters asicParameters, ZipOutputStream zos)
DSSDocument
timestamp(DSSDocument toTimestampDocument, TP parameters)
This method allows to add a timestamp to an unsigned documentMethods inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
assertSigningDateInCertificateValidityRange, getFinalArchiveName, getFinalFileName, setTspSource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.europa.esig.dss.signature.DocumentSignatureService
extendDocument
Methods inherited from interface eu.europa.esig.dss.signature.MultipleDocumentsSignatureService
extendDocument, getContentTimestamp, getDataToSign, signDocument, timestamp
-
Field Details
-
Constructor Details
-
Method Details
-
getExpectedSignatureExtension
-
getContentTimestamp
Description copied from interface:DocumentSignatureService
This method allows to compute a content-timestamp (which is added in the signed properties)- Specified by:
getContentTimestamp
in interfaceDocumentSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
- Parameters:
toSignDocument
- document to sign or the already existing signatureparameters
- set of the driving signing parameters- Returns:
- a timestamp token
-
getDataToSign
Description copied from interface:DocumentSignatureService
Retrieves the bytes of the data that need to be signed based on thetoSignDocument
andparameters
. WhentoSignDocument
contains 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:
getDataToSign
in interfaceDocumentSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
- Parameters:
toSignDocument
- document to sign or the already existing signatureparameters
- set of the driving signing parameters- Returns:
- the data to be signed
-
signDocument
public DSSDocument signDocument(DSSDocument toSignDocument, SP parameters, SignatureValue signatureValue)Description copied from interface:DocumentSignatureService
Signs the toSignDocument with the provided signatureValue.- Specified by:
signDocument
in interfaceDocumentSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
- Parameters:
toSignDocument
- document to signparameters
- set of the driving signing parameterssignatureValue
- the signature value to incorporate- Returns:
- the signed document (
toSignDocument
with the incorporated signature or the detached signature)
-
timestamp
Description copied from interface:DocumentSignatureService
This method allows to add a timestamp to an unsigned document- Specified by:
timestamp
in interfaceDocumentSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
- Overrides:
timestamp
in classAbstractSignatureService<SP extends SerializableSignatureParameters,TP extends SerializableTimestampParameters>
- Parameters:
toTimestampDocument
- the document to be timestampedparameters
- set of the driving timestamping parameters- Returns:
- the timestamped document
-
extractCurrentArchive
-
getArchiveExtractor
-
getEmbeddedSignatures
-
getEmbeddedManifests
-
getEmbeddedArchiveManifests
-
getEmbeddedTimestamps
-
getEmbeddedSignedDocuments
-
getEmbeddedMimetype
-
mergeArchiveAndExtendedSignatures
protected DSSDocument mergeArchiveAndExtendedSignatures(DSSDocument archiveDocument, List<DSSDocument> signaturesToAdd) -
isSignatureFilename
-
buildASiCContainer
protected DSSDocument buildASiCContainer(List<DSSDocument> documentsToBeSigned, List<DSSDocument> signatures, List<DSSDocument> documentsToStore, ASiCParameters asicParameters, DSSDocument rootContainer) -
storeZipComment
-