Interface CMSGenerator

All Known Implementing Classes:
AbstractCMSGenerator, CMSObjectGenerator, CMSStreamGenerator

public interface CMSGenerator
Generates a eu.europa.esig.dss.eu.europa.esig.dss.cms.CMS with the given input data
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates the CMS
    Loads the available CMSGenerator based on the loaded module in the classpath.
    void
    setAttributeCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates)
    Adds attribute certificates
    void
    setCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificateStore)
    Adds certificates to be embedded within SignedData.certificates field
    void
    setCRLs(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls)
    Adds CRLs
    void
    setDigestAlgorithmIDs(Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmIDs)
    Adds a collection of digest algorithm IDs
    void
    setEncapsulate(boolean encapsulate)
    Sets whether the document shall be encapsulated within CMS
    void
    setOcspBasicStore(org.bouncycastle.util.Store<?> ocspBasicStore)
    Adds a collection of OCSP basic responses
    void
    setOcspResponsesStore(org.bouncycastle.util.Store<?> ocspResponsesStore)
    Adds a collection of OCSP responses
    void
    setSignerInfoGenerator(org.bouncycastle.cms.SignerInfoGenerator signerInfoGenerator)
    Adds a SignerInfoGenerator containing information about a new signer to be embedded within CMS
    void
    setSigners(org.bouncycastle.cms.SignerInformationStore signers)
    Adds existing SignerInformation's
    void
    Adds a document to be signed
  • Method Details

    • setSignerInfoGenerator

      void setSignerInfoGenerator(org.bouncycastle.cms.SignerInfoGenerator signerInfoGenerator)
      Adds a SignerInfoGenerator containing information about a new signer to be embedded within CMS
      Parameters:
      signerInfoGenerator - SignerInfoGenerator
    • setCertificates

      void setCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificateStore)
      Adds certificates to be embedded within SignedData.certificates field
      Parameters:
      certificateStore - Store
    • setSigners

      void setSigners(org.bouncycastle.cms.SignerInformationStore signers)
      Adds existing SignerInformation's
      Parameters:
      signers - SignerInformationStore
    • setAttributeCertificates

      void setAttributeCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates)
      Adds attribute certificates
      Parameters:
      attributeCertificates - Store
    • setCRLs

      void setCRLs(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls)
      Adds CRLs
      Parameters:
      crls - Store
    • setOcspBasicStore

      void setOcspBasicStore(org.bouncycastle.util.Store<?> ocspBasicStore)
      Adds a collection of OCSP basic responses
      Parameters:
      ocspBasicStore - Store
    • setOcspResponsesStore

      void setOcspResponsesStore(org.bouncycastle.util.Store<?> ocspResponsesStore)
      Adds a collection of OCSP responses
      Parameters:
      ocspResponsesStore - Store
    • setDigestAlgorithmIDs

      void setDigestAlgorithmIDs(Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmIDs)
      Adds a collection of digest algorithm IDs
      Parameters:
      digestAlgorithmIDs - a collection of AlgorithmIdentifiers
    • setToBeSignedDocument

      void setToBeSignedDocument(DSSDocument document)
      Adds a document to be signed
      Parameters:
      document - DSSDocument
    • setEncapsulate

      void setEncapsulate(boolean encapsulate)
      Sets whether the document shall be encapsulated within CMS
      Parameters:
      encapsulate - whether encapsulate the signed data
    • generate

      CMS generate()
      Generates the CMS
      Returns:
      CMS
    • loadCMSGenerator

      static CMSGenerator loadCMSGenerator()
      Loads the available CMSGenerator based on the loaded module in the classpath. One of the 'dss-cms-object' or 'dss-cms-stream' shall be defined in the list of dependencies.
      Returns:
      CMSGenerator implementation