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.asic.common.signature.AbstractASiCSignatureService<SP,TP,CSP,ERP>
Type Parameters:
SP - implementation of signature parameters corresponding to the supported signature format
TP - implementation of timestamp parameters corresponding to the supported document format
CSP - implementation of counter-signature parameters corresponding to the supported signature format
ERP - implementation of parameters used for evidince record embedding
All Implemented Interfaces:
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 Object
The abstract class containing the main methods for ASiC signature creation/extension
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final eu.europa.esig.dss.spi.validation.CertificateVerifier
     
    protected eu.europa.esig.dss.spi.x509.tsp.TSPSource
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractASiCSignatureService(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
    The default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    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 the evidenceRecordDocument applied to the document.
    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 the evidenceRecordDocument applied to the documents.
    eu.europa.esig.dss.model.DSSDocument
    addSignatureEvidenceRecord(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.model.DSSDocument arg1, ERP arg2)
     
    protected void
    Verifies if incorporation of a SignaturePolicyStore is possible
    protected void
    Verifies a validity of counter signature parameters
    protected void
    assertSignaturePossible(List<eu.europa.esig.dss.model.DSSDocument> documentsToSign)
    This method verifies whether the signature creation is possible with the provided documents
    protected void
    assertSigningCertificateValid(eu.europa.esig.dss.signature.AbstractSignatureParameters<?> arg0)
     
    protected eu.europa.esig.dss.model.DSSDocument
    Creates a ZIP-Archive by copying the provided documents to the new container using the current time as ZIP creation time
    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
    eu.europa.esig.dss.model.DSSDocument
    counterSignSignature(eu.europa.esig.dss.model.DSSDocument arg0, CSP arg1, eu.europa.esig.dss.model.SignatureValue arg2)
     
    protected eu.europa.esig.dss.model.SignatureValue
    ensureSignatureValue(eu.europa.esig.dss.enumerations.SignatureAlgorithm arg0, eu.europa.esig.dss.model.SignatureValue arg1)
     
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.model.DSSDocument arg0, SP arg1)
     
    eu.europa.esig.dss.model.DSSDocument
    extendDocument(eu.europa.esig.dss.model.DSSDocument arg0, SP arg1)
     
    protected ASiCContent
    extractCurrentArchive(eu.europa.esig.dss.model.DSSDocument archive)
    Extracts the content (documents) of the ASiC container
    getArchiveExtractor(eu.europa.esig.dss.model.DSSDocument archive)
    Returns a relevant ASiC container extractor for the given format
    eu.europa.esig.dss.spi.x509.tsp.TimestampToken
    getContentTimestamp(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters)
     
    eu.europa.esig.dss.spi.x509.tsp.TimestampToken
    getContentTimestamp(List<eu.europa.esig.dss.model.DSSDocument> arg0, SP arg1)
     
    eu.europa.esig.dss.model.ToBeSigned
    getDataToBeCounterSigned(eu.europa.esig.dss.model.DSSDocument arg0, CSP arg1)
     
    eu.europa.esig.dss.model.ToBeSigned
    getDataToSign(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters)
     
    eu.europa.esig.dss.model.ToBeSigned
    getDataToSign(List<eu.europa.esig.dss.model.DSSDocument> arg0, SP arg1)
     
    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
    protected String
    getFinalDocumentName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2, eu.europa.esig.dss.enumerations.MimeType arg3)
     
    protected String
    getFinalDocumentName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2, eu.europa.esig.dss.enumerations.SignaturePackaging arg3, eu.europa.esig.dss.enumerations.MimeType arg4)
     
    protected String
    getFinalFileName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1)
     
    protected String
    getFinalFileName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2)
     
    protected String
    getFinalFileName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2, eu.europa.esig.dss.enumerations.SignaturePackaging arg3)
     
    boolean
    isValidSignatureValue(eu.europa.esig.dss.model.ToBeSigned arg0, eu.europa.esig.dss.model.SignatureValue arg1, eu.europa.esig.dss.model.x509.CertificateToken arg2)
     
    boolean
    isValidSignatureValue(eu.europa.esig.dss.model.ToBeSigned arg0, eu.europa.esig.dss.model.SignatureValue arg1, eu.europa.esig.dss.model.x509.CertificateToken arg2)
     
    void
    setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource arg0)
     
    void
    setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource arg0)
     
    eu.europa.esig.dss.model.DSSDocument
    signDocument(eu.europa.esig.dss.model.DSSDocument toSignDocument, SP parameters, eu.europa.esig.dss.model.SignatureValue signatureValue)
     
    eu.europa.esig.dss.model.DSSDocument
    signDocument(List<eu.europa.esig.dss.model.DSSDocument> arg0, SP arg1, eu.europa.esig.dss.model.SignatureValue arg2)
     
    eu.europa.esig.dss.model.DSSDocument
    timestamp(eu.europa.esig.dss.model.DSSDocument toTimestampDocument, TP parameters)
     
    eu.europa.esig.dss.model.DSSDocument
    timestamp(List<eu.europa.esig.dss.model.DSSDocument> arg0, TP arg1)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • certificateVerifier

      protected final eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier
    • tspSource

      protected eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource
  • 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)
    • 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 the evidenceRecordDocument applied to the document.

      If the provided original document is an existing ASiC container, then the evidenceRecordDocument will be evaluated against the container files and places within the container.

      Parameters:
      document - a list of DSSDocuments preserved by an evidence record
      evidenceRecordDocument - DSSDocument to add
      parameters - ASiCContainerEvidenceRecordParameters providing configuration for the evidence record incorporation
      Returns:
      DSSDocument ASiC 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 the evidenceRecordDocument applied to the documents.

      If the provided original document is an existing ASiC container, then the evidenceRecordDocument will be evaluated against the container files and places within the container.

      Parameters:
      documents - a list of DSSDocuments preserved by an evidence record
      evidenceRecordDocument - DSSDocument to add
      parameters - ASiCContainerEvidenceRecordParameters providing configuration for the evidence record incorporation
      Returns:
      DSSDocument ASiC container containing the evidence record file document
    • extractCurrentArchive

      protected ASiCContent extractCurrentArchive(eu.europa.esig.dss.model.DSSDocument archive)
      Extracts the content (documents) of the ASiC container
      Parameters:
      archive - DSSDocument representing 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 - DSSDocument to get an extractor for
      Returns:
      an instance of DefaultASiCContainerExtractor
    • buildASiCContainer

      protected eu.europa.esig.dss.model.DSSDocument buildASiCContainer(ASiCContent asicContent)
      Creates a ZIP-Archive by copying the provided documents to the new container using the current time as ZIP creation time
      Parameters:
      asicContent - ASiCContent to create a new ZIP archive from
      Returns:
      DSSDocument the 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 - ASiCContent to create a new ZIP archive from
      creationTime - Date of the archive creation (optional)
      Returns:
      DSSDocument the created ASiC Container
    • assertSignaturePossible

      protected void assertSignaturePossible(List<eu.europa.esig.dss.model.DSSDocument> documentsToSign)
      This method verifies whether the signature creation is possible with the provided documents
      Parameters:
      documentsToSign - a list of DSSDocuments
    • assertCounterSignatureParametersValid

      protected void assertCounterSignatureParametersValid(CSP parameters)
      Verifies a validity of counter signature parameters
      Parameters:
      parameters - counter signature parameters to verify
    • assertAddSignaturePolicyStorePossible

      protected void assertAddSignaturePolicyStorePossible(ASiCContent asicContent)
      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 - DSSDocument original signed/extended document container
      operation - SigningOperation the performed signing operation
      containerMimeType - MimeType the expected mimeType
      Returns:
      String the archive filename
    • getContentTimestamp

      eu.europa.esig.dss.spi.x509.tsp.TimestampToken getContentTimestamp(List<eu.europa.esig.dss.model.DSSDocument> arg0, SP arg1)
    • getDataToSign

      eu.europa.esig.dss.model.ToBeSigned getDataToSign(List<eu.europa.esig.dss.model.DSSDocument> arg0, SP arg1)
    • isValidSignatureValue

      boolean isValidSignatureValue(eu.europa.esig.dss.model.ToBeSigned arg0, eu.europa.esig.dss.model.SignatureValue arg1, eu.europa.esig.dss.model.x509.CertificateToken arg2)
    • signDocument

      eu.europa.esig.dss.model.DSSDocument signDocument(List<eu.europa.esig.dss.model.DSSDocument> arg0, SP arg1, eu.europa.esig.dss.model.SignatureValue arg2)
    • extendDocument

      eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.model.DSSDocument arg0, SP arg1)
    • timestamp

      eu.europa.esig.dss.model.DSSDocument timestamp(List<eu.europa.esig.dss.model.DSSDocument> arg0, TP arg1)
    • getDataToBeCounterSigned

      eu.europa.esig.dss.model.ToBeSigned getDataToBeCounterSigned(eu.europa.esig.dss.model.DSSDocument arg0, CSP arg1)
    • counterSignSignature

      eu.europa.esig.dss.model.DSSDocument counterSignSignature(eu.europa.esig.dss.model.DSSDocument arg0, CSP arg1, eu.europa.esig.dss.model.SignatureValue arg2)
    • setTspSource

      void setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource arg0)
    • addSignatureEvidenceRecord

      eu.europa.esig.dss.model.DSSDocument addSignatureEvidenceRecord(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.model.DSSDocument arg1, ERP arg2)
    • setTspSource

      public void setTspSource(eu.europa.esig.dss.spi.x509.tsp.TSPSource arg0)
    • assertSigningCertificateValid

      protected void assertSigningCertificateValid(eu.europa.esig.dss.signature.AbstractSignatureParameters<?> arg0)
    • ensureSignatureValue

      protected eu.europa.esig.dss.model.SignatureValue ensureSignatureValue(eu.europa.esig.dss.enumerations.SignatureAlgorithm arg0, eu.europa.esig.dss.model.SignatureValue arg1)
    • getFinalDocumentName

      protected String getFinalDocumentName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2, eu.europa.esig.dss.enumerations.SignaturePackaging arg3, eu.europa.esig.dss.enumerations.MimeType arg4)
    • getFinalFileName

      protected String getFinalFileName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1)
    • getFinalFileName

      protected String getFinalFileName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2)
    • getFinalFileName

      protected String getFinalFileName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2, eu.europa.esig.dss.enumerations.SignaturePackaging arg3)
    • getFinalDocumentName

      protected String getFinalDocumentName(eu.europa.esig.dss.model.DSSDocument arg0, eu.europa.esig.dss.enumerations.SigningOperation arg1, eu.europa.esig.dss.enumerations.SignatureLevel arg2, eu.europa.esig.dss.enumerations.MimeType arg3)
    • isValidSignatureValue

      public boolean isValidSignatureValue(eu.europa.esig.dss.model.ToBeSigned arg0, eu.europa.esig.dss.model.SignatureValue arg1, eu.europa.esig.dss.model.x509.CertificateToken arg2)
    • extendDocument

      eu.europa.esig.dss.model.DSSDocument extendDocument(eu.europa.esig.dss.model.DSSDocument arg0, SP arg1)