Class CAdESLevelBaselineLT

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

public class CAdESLevelBaselineLT extends CAdESLevelBaselineT
This class holds the CAdES-LT signature profiles
  • Field Details

    • tspSource

      protected final TSPSource tspSource
      The TSPSource to request a timestamp (T- and LTA-levels)
    • certificateVerifier

      protected final CertificateVerifier certificateVerifier
      The CertificateVerifier to use
    • resourcesHandlerBuilder

      protected DSSResourcesHandlerBuilder resourcesHandlerBuilder
      This object is used to create data container objects such as an OutputStream or a DSSDocument
  • Constructor Details

  • Method Details

    • extendCMSSignatures

      protected CMS extendCMSSignatures(CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend)
      This method extends the signatures in the cmsSignedData with ids listed within signatureIdsToExtend
      Overrides:
      extendCMSSignatures in class CAdESLevelBaselineT
      Parameters:
      cms - CMS containing the signatures to be extended
      parameters - CAdESSignatureParameters
      signatureIdsToExtend - a list of String signature Ids to be extended
      Returns:
      CMS
    • includesATSv2

      protected boolean includesATSv2(CMS cms)
      Verifies if the CMS contains an ATSTv2
      Parameters:
      cms - CMS to check
      Returns:
      TRUE if the cms contains an ATSTv2, FALSE otherwise
    • getExtendToLTLevelSignatures

      protected List<AdvancedSignature> getExtendToLTLevelSignatures(List<AdvancedSignature> signatures, List<String> signatureIdsToExtend)
      Returns a list of signatures to be extended according to th list of signatureIdsToExtend
      Parameters:
      signatures - a list of AdvancedSignatures
      signatureIdsToExtend - a list of String signature identifiers to be extended
      Returns:
      a list of AdvancedSignatures
    • setResourcesHandlerBuilder

      public void setResourcesHandlerBuilder(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 DSSDocument extendSignatures(DSSDocument signatureToExtend, CAdESSignatureParameters parameters)
      Extends CMS signatures provided within the signatureToExtend document
      Specified by:
      extendSignatures in interface SignatureExtension<CAdESSignatureParameters>
      Parameters:
      signatureToExtend - DSSDocument to be extended
      parameters - CAdESSignatureParameters of the extension
      Returns:
      DSSDocument a new extended document
    • extendCMSSignatures

      public CMS extendCMSSignatures(CMS cms, CAdESSignatureParameters parameters)
      Extends a CMS
      Parameters:
      cms - CMS to extend
      parameters - CAdESSignatureParameters
      Returns:
      CMS
    • extendCMSSignatures

      public CMS extendCMSSignatures(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 CMS extendCMSSignatures(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 CMS replaceSigners(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(DSSMessageDigest timestampMessageDigest, 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(CMS cms, CAdESSignatureParameters parameters)
      This method returns a document validator for a CMS
      Parameters:
      cms - CMS to get validation for
      parameters - CAdESSignatureParameters
      Returns:
      CMSDocumentAnalyzer