Module jpms_dss_asic_common
Class AbstractASiCSignatureService<SP extends eu.europa.esig.dss.model.SerializableSignatureParameters,TP extends eu.europa.esig.dss.model.SerializableTimestampParameters,CSP extends eu.europa.esig.dss.model.SerializableCounterSignatureParameters,ERP extends eu.europa.esig.dss.model.SerializableEvidenceRecordIncorporationParameters>
java.lang.Object
eu.europa.esig.dss.signature.AbstractSignatureService<SP,TP>
eu.europa.esig.dss.asic.common.signature.AbstractASiCSignatureService<SP,TP,CSP,ERP>
- Type Parameters:
SP- implementation of signature parameters corresponding to the supported signature formatTP- implementation of timestamp parameters corresponding to the supported document formatCSP- implementation of counter-signature parameters corresponding to the supported signature formatERP- implementation of parameters used for evidince record embedding
- All Implemented Interfaces:
eu.europa.esig.dss.evidencerecord.EvidenceRecordIncorporationService<ERP>,eu.europa.esig.dss.signature.CounterSignatureService<CSP>,eu.europa.esig.dss.signature.DocumentSignatureService<SP,,TP> eu.europa.esig.dss.signature.MultipleDocumentsSignatureService<SP,,TP> Serializable
public abstract class AbstractASiCSignatureService<SP extends eu.europa.esig.dss.model.SerializableSignatureParameters,TP extends eu.europa.esig.dss.model.SerializableTimestampParameters,CSP extends eu.europa.esig.dss.model.SerializableCounterSignatureParameters,ERP extends eu.europa.esig.dss.model.SerializableEvidenceRecordIncorporationParameters>
extends eu.europa.esig.dss.signature.AbstractSignatureService<SP,TP>
implements eu.europa.esig.dss.signature.MultipleDocumentsSignatureService<SP,TP>, eu.europa.esig.dss.signature.CounterSignatureService<CSP>, eu.europa.esig.dss.evidencerecord.EvidenceRecordIncorporationService<ERP>
The abstract class containing the main methods for ASiC signature creation/extension
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
certificateVerifier, tspSource -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractASiCSignatureService(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier) The default constructor -
Method Summary
Modifier and TypeMethodDescriptioneu.europa.esig.dss.model.DSSDocumentaddContainerEvidenceRecord(eu.europa.esig.dss.model.DSSDocument document, eu.europa.esig.dss.model.DSSDocument evidenceRecordDocument, ASiCContainerEvidenceRecordParameters parameters) Creates a new ASiC container with theevidenceRecordDocumentapplied to thedocument.abstract eu.europa.esig.dss.model.DSSDocumentaddContainerEvidenceRecord(List<eu.europa.esig.dss.model.DSSDocument> documents, eu.europa.esig.dss.model.DSSDocument evidenceRecordDocument, ASiCContainerEvidenceRecordParameters parameters) Creates a new ASiC container with theevidenceRecordDocumentapplied to thedocuments.protected voidassertAddSignaturePolicyStorePossible(ASiCContent asicContent) Verifies if incorporation of a SignaturePolicyStore is possibleprotected voidassertCounterSignatureParametersValid(CSP parameters) Verifies a validity of counter signature parametersprotected voidassertSignaturePossible(List<eu.europa.esig.dss.model.DSSDocument> documentsToSign) This method verifies whether the signature creation is possible with the provided documentsprotected eu.europa.esig.dss.model.DSSDocumentbuildASiCContainer(ASiCContent asicContent) Creates a ZIP-Archive by copying the provided documents to the new container using the current time as ZIP creation timeprotected eu.europa.esig.dss.model.DSSDocumentbuildASiCContainer(ASiCContent asicContent, Date creationTime) Creates a ZIP-Archive by copying the provided documents to the new containerprotected ASiCContentextractCurrentArchive(eu.europa.esig.dss.model.DSSDocument archive) Extracts the content (documents) of the ASiC containerprotected abstract DefaultASiCContainerExtractorgetArchiveExtractor(eu.europa.esig.dss.model.DSSDocument archive) Returns a relevant ASiC container extractor for the given formateu.europa.esig.dss.spi.x509.tsp.TimestampTokengetContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters) eu.europa.esig.dss.model.ToBeSignedgetDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters) protected StringgetFinalArchiveName(eu.europa.esig.dss.model.DSSDocument originalFile, eu.europa.esig.dss.enumerations.SigningOperation operation, eu.europa.esig.dss.enumerations.MimeType containerMimeType) Generates and returns a final name for the archive to createeu.europa.esig.dss.model.DSSDocumentsignDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters, eu.europa.esig.dss.model.SignatureValue signatureValue) eu.europa.esig.dss.model.DSSDocumentMethods inherited from class eu.europa.esig.dss.signature.AbstractSignatureService
assertSigningCertificateValid, ensureSignatureValue, getFinalDocumentName, getFinalDocumentName, getFinalFileName, 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.CounterSignatureService
counterSignSignature, getDataToBeCounterSigned, setTspSourceMethods inherited from interface eu.europa.esig.dss.signature.DocumentSignatureService
extendDocumentMethods inherited from interface eu.europa.esig.dss.evidencerecord.EvidenceRecordIncorporationService
addSignatureEvidenceRecordMethods inherited from interface eu.europa.esig.dss.signature.MultipleDocumentsSignatureService
extendDocument, getContentTimestamp, getDataToSign, isValidSignatureValue, signDocument, timestamp
-
Constructor Details
-
AbstractASiCSignatureService
protected AbstractASiCSignatureService(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier) The default constructor- Parameters:
certificateVerifier-CertificateVerifier
-
-
Method Details
-
getContentTimestamp
public eu.europa.esig.dss.spi.x509.tsp.TimestampToken getContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters) -
getDataToSign
public eu.europa.esig.dss.model.ToBeSigned getDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters) -
signDocument
public eu.europa.esig.dss.model.DSSDocument signDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters, eu.europa.esig.dss.model.SignatureValue signatureValue) -
timestamp
public eu.europa.esig.dss.model.DSSDocument timestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, TP parameters) - Specified by:
timestampin interfaceeu.europa.esig.dss.signature.DocumentSignatureService<SP extends eu.europa.esig.dss.model.SerializableSignatureParameters,TP extends eu.europa.esig.dss.model.SerializableTimestampParameters> - Overrides:
timestampin classeu.europa.esig.dss.signature.AbstractSignatureService<SP extends eu.europa.esig.dss.model.SerializableSignatureParameters,TP extends eu.europa.esig.dss.model.SerializableTimestampParameters>
-
addContainerEvidenceRecord
public eu.europa.esig.dss.model.DSSDocument addContainerEvidenceRecord(eu.europa.esig.dss.model.DSSDocument document, eu.europa.esig.dss.model.DSSDocument evidenceRecordDocument, ASiCContainerEvidenceRecordParameters parameters) Creates a new ASiC container with theevidenceRecordDocumentapplied to thedocument.If the provided original document is an existing ASiC container, then the
evidenceRecordDocumentwill be evaluated against the container files and places within the container.- Parameters:
document- a list ofDSSDocuments preserved by an evidence recordevidenceRecordDocument-DSSDocumentto addparameters-ASiCContainerEvidenceRecordParametersproviding configuration for the evidence record incorporation- Returns:
DSSDocumentASiC container containing the evidence record file document
-
addContainerEvidenceRecord
public abstract eu.europa.esig.dss.model.DSSDocument addContainerEvidenceRecord(List<eu.europa.esig.dss.model.DSSDocument> documents, eu.europa.esig.dss.model.DSSDocument evidenceRecordDocument, ASiCContainerEvidenceRecordParameters parameters) Creates a new ASiC container with theevidenceRecordDocumentapplied to thedocuments.If the provided original document is an existing ASiC container, then the
evidenceRecordDocumentwill be evaluated against the container files and places within the container.- Parameters:
documents- a list ofDSSDocuments preserved by an evidence recordevidenceRecordDocument-DSSDocumentto addparameters-ASiCContainerEvidenceRecordParametersproviding configuration for the evidence record incorporation- Returns:
DSSDocumentASiC container containing the evidence record file document
-
extractCurrentArchive
Extracts the content (documents) of the ASiC container- Parameters:
archive-DSSDocumentrepresenting an ASiC container- Returns:
ASiCContent
-
getArchiveExtractor
protected abstract DefaultASiCContainerExtractor getArchiveExtractor(eu.europa.esig.dss.model.DSSDocument archive) Returns a relevant ASiC container extractor for the given format- Parameters:
archive-DSSDocumentto get an extractor for- Returns:
- an instance of
DefaultASiCContainerExtractor
-
buildASiCContainer
Creates a ZIP-Archive by copying the provided documents to the new container using the current time as ZIP creation time- Parameters:
asicContent-ASiCContentto create a new ZIP archive from- Returns:
DSSDocumentthe created ASiC Container
-
buildASiCContainer
protected eu.europa.esig.dss.model.DSSDocument buildASiCContainer(ASiCContent asicContent, Date creationTime) Creates a ZIP-Archive by copying the provided documents to the new container- Parameters:
asicContent-ASiCContentto create a new ZIP archive fromcreationTime-Dateof the archive creation (optional)- Returns:
DSSDocumentthe created ASiC Container
-
assertSignaturePossible
This method verifies whether the signature creation is possible with the provided documents- Parameters:
documentsToSign- a list ofDSSDocuments
-
assertCounterSignatureParametersValid
Verifies a validity of counter signature parameters- Parameters:
parameters- counter signature parameters to verify
-
assertAddSignaturePolicyStorePossible
Verifies if incorporation of a SignaturePolicyStore is possible- Parameters:
asicContent-ASiCContent
-
getFinalArchiveName
protected String getFinalArchiveName(eu.europa.esig.dss.model.DSSDocument originalFile, eu.europa.esig.dss.enumerations.SigningOperation operation, eu.europa.esig.dss.enumerations.MimeType containerMimeType) Generates and returns a final name for the archive to create- Parameters:
originalFile-DSSDocumentoriginal signed/extended document containeroperation-SigningOperationthe performed signing operationcontainerMimeType-MimeTypethe expected mimeType- Returns:
Stringthe archive filename
-