Class CMSSignedDataStream

java.lang.Object
eu.europa.esig.dss.cms.stream.CMSSignedDataStream

public class CMSSignedDataStream extends Object
Implementation of a CMS based on a parsed content.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor to create an empty instance on CMS creation
    Constructor to create a copy of cms
    CMSSignedDataStream(eu.europa.esig.dss.model.DSSDocument cmsDocument)
    This constructor is used to create an instance of CMSSignedDataStream on parsing of an existing CMS document
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder>
     
    org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder>
     
    eu.europa.esig.dss.model.DSSDocument
    Gets the original CMS document used to create the CMS
    org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder>
     
    byte[]
     
    Set<org.bouncycastle.asn1.x509.AlgorithmIdentifier>
     
    byte[]
     
    org.bouncycastle.util.Store<?>
     
    org.bouncycastle.util.Store<?>
     
    eu.europa.esig.dss.model.DSSDocument
     
    org.bouncycastle.asn1.ASN1ObjectIdentifier
     
    org.bouncycastle.cms.SignerInformationStore
     
    int
     
    boolean
     
    void
    setAttributeCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates)
    Sets attribute certificates incorporates within CMS
    void
    setCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificates)
    Sets the certificates store, representing the value of SignedData.certificates field
    void
    setCRLs(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls)
    Sets the CRLs store (OCSP excluded), representing the value of SignedData.crls field
    void
    setDetachedSignature(boolean detachedSignature)
    Sets whether the signature is detached (i.e.
    void
    setDigestAlgorithmIDs(Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmIDs)
    Sets a set of algorithm identifiers (OIDs) incorporated within SignedData.digestAlgorithms field of CMS
    void
    setOcspBasicStore(org.bouncycastle.util.Store<?> ocspBasicStore)
    Sets the OCSP Basic Store, incorporated within the SignedData.crls field
    void
    setOcspResponseStore(org.bouncycastle.util.Store<?> ocspResponseStore)
    Sets the OCSP Responses Store, incorporated within the SignedData.crls field
    void
    setSignedContent(eu.europa.esig.dss.model.DSSDocument signedContent)
    Sets the signed content incorporated within the SignedData.encapContentInfo.eContent field
    void
    setSignedContentType(org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType)
    Sets signed content type, present within the SignedData.encapContentInfo.eContentType field
    void
    setSignerInfos(org.bouncycastle.cms.SignerInformationStore signerInfos)
    Sets the signers of the signature, incorporated within the SignedData.signerInfos field
    void
    setVersion(int version)
    Sets value of SignedData.version field

    Methods inherited from class Object

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

    • CMSSignedDataStream

      public CMSSignedDataStream()
      Default constructor to create an empty instance on CMS creation
    • CMSSignedDataStream

      public CMSSignedDataStream(CMSSignedDataStream cms)
      Constructor to create a copy of cms
      Parameters:
      cms - CMSSignedDataStream
    • CMSSignedDataStream

      public CMSSignedDataStream(eu.europa.esig.dss.model.DSSDocument cmsDocument)
      This constructor is used to create an instance of CMSSignedDataStream on parsing of an existing CMS document
      Parameters:
      cmsDocument - DSSDocument original document provided on parsing
  • Method Details

    • getCMSDocument

      public eu.europa.esig.dss.model.DSSDocument getCMSDocument()
      Gets the original CMS document used to create the CMS
      Returns:
      DSSDocument
    • getVersion

      public int getVersion()
    • setVersion

      public void setVersion(int version)
      Sets value of SignedData.version field
      Parameters:
      version - integer value
    • getDigestAlgorithmIDs

      public Set<org.bouncycastle.asn1.x509.AlgorithmIdentifier> getDigestAlgorithmIDs()
    • setDigestAlgorithmIDs

      public void setDigestAlgorithmIDs(Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmIDs)
      Sets a set of algorithm identifiers (OIDs) incorporated within SignedData.digestAlgorithms field of CMS
      Parameters:
      digestAlgorithmIDs - a collection of AlgorithmIdentifiers
    • isDetachedSignature

      public boolean isDetachedSignature()
    • setDetachedSignature

      public void setDetachedSignature(boolean detachedSignature)
      Sets whether the signature is detached (i.e. SignedData.encapContentInfo.eContent is null)
      Parameters:
      detachedSignature - whether the signature is detached
    • getSignedContentType

      public org.bouncycastle.asn1.ASN1ObjectIdentifier getSignedContentType()
    • setSignedContentType

      public void setSignedContentType(org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType)
      Sets signed content type, present within the SignedData.encapContentInfo.eContentType field
      Parameters:
      signedContentType - ASN1ObjectIdentifier
    • getSignedContent

      public eu.europa.esig.dss.model.DSSDocument getSignedContent()
    • setSignedContent

      public void setSignedContent(eu.europa.esig.dss.model.DSSDocument signedContent)
      Sets the signed content incorporated within the SignedData.encapContentInfo.eContent field
      Parameters:
      signedContent - DSSDocument
    • getCertificates

      public org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> getCertificates()
    • setCertificates

      public void setCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificates)
      Sets the certificates store, representing the value of SignedData.certificates field
      Parameters:
      certificates - Store
    • getAttributeCertificates

      public org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> getAttributeCertificates()
    • setAttributeCertificates

      public void setAttributeCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates)
      Sets attribute certificates incorporates within CMS
      Parameters:
      attributeCertificates - Store
    • getCRLs

      public org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> getCRLs()
    • setCRLs

      public void setCRLs(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls)
      Sets the CRLs store (OCSP excluded), representing the value of SignedData.crls field
      Parameters:
      crls - Store
    • getOcspResponseStore

      public org.bouncycastle.util.Store<?> getOcspResponseStore()
    • setOcspResponseStore

      public void setOcspResponseStore(org.bouncycastle.util.Store<?> ocspResponseStore)
      Sets the OCSP Responses Store, incorporated within the SignedData.crls field
      Parameters:
      ocspResponseStore - Store
    • getOcspBasicStore

      public org.bouncycastle.util.Store<?> getOcspBasicStore()
    • setOcspBasicStore

      public void setOcspBasicStore(org.bouncycastle.util.Store<?> ocspBasicStore)
      Sets the OCSP Basic Store, incorporated within the SignedData.crls field
      Parameters:
      ocspBasicStore - Store
    • getSignerInfos

      public org.bouncycastle.cms.SignerInformationStore getSignerInfos()
    • setSignerInfos

      public void setSignerInfos(org.bouncycastle.cms.SignerInformationStore signerInfos)
      Sets the signers of the signature, incorporated within the SignedData.signerInfos field
      Parameters:
      signerInfos - SignerInformationStore
    • getDEREncoded

      public byte[] getDEREncoded()
    • getEncoded

      public byte[] getEncoded()