Class CAdESLevelBaselineT

java.lang.Object
eu.europa.esig.dss.cades.signature.CAdESLevelBaselineT
All Implemented Interfaces:
eu.europa.esig.dss.signature.SignatureExtension<CAdESSignatureParameters>
Direct Known Subclasses:
CAdESLevelBaselineLT

public class CAdESLevelBaselineT extends Object
This class holds the CAdES-T signature profile; it supports the inclusion of the mandatory unsigned id-aa-signatureTimeStampToken attribute as specified in ETSI TS 101 733 V1.8.1, clause 6.1.1.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final eu.europa.esig.dss.spi.validation.CertificateVerifier
    The CertificateVerifier to use
    protected eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder
    This object is used to create data container objects such as an OutputStream or a DSSDocument
    protected final eu.europa.esig.dss.spi.x509.tsp.TSPSource
    The TSPSource to request a timestamp (T- and LTA-levels)
  • Constructor Summary

    Constructors
    Constructor
    Description
    CAdESLevelBaselineT(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource, eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
    The default constructor with a CertificateVerifier
  • Method Summary

    Modifier and Type
    Method
    Description
    eu.europa.esig.dss.cms.CMS
    extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters)
    Extends a CMS
    protected eu.europa.esig.dss.cms.CMS
    extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend)
    This method extends the signatures in the cmsSignedData with ids listed within signatureIdsToExtend
    protected eu.europa.esig.dss.cms.CMS
    extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters)
    Loops on each signerInformation of the cmsSignedData and extends ones defined in the collection signerInformationsToExtend
    eu.europa.esig.dss.cms.CMS
    extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters)
    Extends a CMS with a specified SignerInformation NOTE: does not modify other SignerInformations
    eu.europa.esig.dss.model.DSSDocument
    extendSignatures(eu.europa.esig.dss.model.DSSDocument signatureToExtend, CAdESSignatureParameters parameters)
    Extends CMS signatures provided within the signatureToExtend document
    getDocumentValidator(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters)
    This method returns a document validator for a CMS
    protected eu.europa.esig.dss.signature.SignatureRequirementsChecker
    Instantiates a SignatureRequirementsChecker
    protected org.bouncycastle.asn1.ASN1Object
    getTimeStampAttributeValue(eu.europa.esig.dss.model.DSSMessageDigest timestampMessageDigest, eu.europa.esig.dss.enumerations.DigestAlgorithm timestampDigestAlgorithm, org.bouncycastle.asn1.cms.Attribute... attributesForTimestampToken)
    Generates and returns a TimeStamp attribute value
    protected eu.europa.esig.dss.cms.CMS
    replaceSigners(eu.europa.esig.dss.cms.CMS originalCMS, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList)
    This method replaces the signers within the provided originalCMS
    void
    setResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder)
    This method sets a DSSResourcesHandlerBuilder to be used for operating with internal objects during the signature creation procedure.

    Methods inherited from class java.lang.Object

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

    • tspSource

      protected final eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource
      The TSPSource to request a timestamp (T- and LTA-levels)
    • certificateVerifier

      protected final eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier
      The CertificateVerifier to use
    • resourcesHandlerBuilder

      protected eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder
      This object is used to create data container objects such as an OutputStream or a DSSDocument
  • Constructor Details

    • CAdESLevelBaselineT

      public CAdESLevelBaselineT(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource, eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
      The default constructor with a CertificateVerifier
      Parameters:
      tspSource - TSPSource to request a timestamp
      certificateVerifier - CertificateVerifier
  • Method Details

    • extendCMSSignatures

      protected eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend)
      This method extends the signatures in the cmsSignedData with ids listed within signatureIdsToExtend
      Parameters:
      cms - CMS containing the signatures to be extended
      parameters - CAdESSignatureParameters
      signatureIdsToExtend - a list of String signature Ids to be extended
      Returns:
      CMS
    • getSignatureRequirementsChecker

      protected eu.europa.esig.dss.signature.SignatureRequirementsChecker getSignatureRequirementsChecker(CAdESSignatureParameters parameters)
      Instantiates a SignatureRequirementsChecker
      Parameters:
      parameters - CAdESSignatureParameters
      Returns:
      SignatureRequirementsChecker
    • setResourcesHandlerBuilder

      public void setResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder)
      This method sets a DSSResourcesHandlerBuilder to be used for operating with internal objects during the signature creation procedure.
      Parameters:
      resourcesHandlerBuilder - DSSResourcesHandlerBuilder
    • extendSignatures

      public eu.europa.esig.dss.model.DSSDocument extendSignatures(eu.europa.esig.dss.model.DSSDocument signatureToExtend, CAdESSignatureParameters parameters)
      Extends CMS signatures provided within the signatureToExtend document
      Specified by:
      extendSignatures in interface eu.europa.esig.dss.signature.SignatureExtension<CAdESSignatureParameters>
      Parameters:
      signatureToExtend - DSSDocument to be extended
      parameters - CAdESSignatureParameters of the extension
      Returns:
      DSSDocument a new extended document
    • extendCMSSignatures

      public eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters)
      Extends a CMS
      Parameters:
      cms - CMS to extend
      parameters - CAdESSignatureParameters
      Returns:
      CMS
    • extendCMSSignatures

      public eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters)
      Extends a CMS with a specified SignerInformation NOTE: does not modify other SignerInformations
      Parameters:
      cms - CMS to extend
      signerInformation - SignerInformation to extend
      parameters - CAdESSignatureParameters
      Returns:
      CMS
    • extendCMSSignatures

      protected eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters)
      Loops on each signerInformation of the cmsSignedData and extends ones defined in the collection signerInformationsToExtend
      Parameters:
      cms - CMS
      signerInformationsToExtend - a collection of SignerInformation to be extended
      parameters - CAdESSignatureParameters for the extension
      Returns:
      CMS with extended signerInformations
    • replaceSigners

      protected eu.europa.esig.dss.cms.CMS replaceSigners(eu.europa.esig.dss.cms.CMS originalCMS, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList)
      This method replaces the signers within the provided originalCMS
      Parameters:
      originalCMS - CMS to replace SignerInformations within
      newSignerInformationList - a list of new SignerInformations
      Returns:
      CMS
    • getTimeStampAttributeValue

      protected org.bouncycastle.asn1.ASN1Object getTimeStampAttributeValue(eu.europa.esig.dss.model.DSSMessageDigest timestampMessageDigest, eu.europa.esig.dss.enumerations.DigestAlgorithm timestampDigestAlgorithm, org.bouncycastle.asn1.cms.Attribute... attributesForTimestampToken)
      Generates and returns a TimeStamp attribute value
      Parameters:
      timestampMessageDigest - DSSMessageDigest message-digest to be timestamped
      timestampDigestAlgorithm - DigestAlgorithm to use
      attributesForTimestampToken - Attributes to add
      Returns:
      ASN1Object representing a TimeStamp token attribute value
    • getDocumentValidator

      protected CMSDocumentAnalyzer getDocumentValidator(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters)
      This method returns a document validator for a CMS
      Parameters:
      cms - CMS to get validation for
      parameters - CAdESSignatureParameters
      Returns:
      CMSDocumentAnalyzer