Class CMSSignedContentDocument

java.lang.Object
eu.europa.esig.dss.model.CommonDocument
eu.europa.esig.dss.cms.stream.CMSSignedContentDocument
All Implemented Interfaces:
DSSDocument, Serializable

public class CMSSignedContentDocument extends CommonDocument
This class is used to extract a wrapped signed content from a CMS document. The class allows providing digest in order to avoid reading the document.
See Also:
  • Constructor Details

    • CMSSignedContentDocument

      public CMSSignedContentDocument(DSSDocument cmsDocument)
      Constructor with a null signed content type
      Parameters:
      cmsDocument - DSSDocument representing the CMS document
    • CMSSignedContentDocument

      public CMSSignedContentDocument(DSSDocument cmsDocument, org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType)
      Constructor with a provided signed content type
      Parameters:
      cmsDocument - DSSDocument representing the CMS document
      signedContentType - ASN1ObjectIdentifier
  • Method Details

    • openStream

      public InputStream openStream()
      Description copied from interface: DSSDocument
      Opens a InputStream on the DSSDocument contents. The type of the InputStream depends on the type of the DSSDocument.
      Returns:
      an InputStream
    • toCMSTypedData

      public org.bouncycastle.cms.CMSTypedData toCMSTypedData()
      Returns a CMSTypedData for a signature creation
      Returns:
      CMSTypedData
    • addDigest

      public void addDigest(Digest digest)
      This method allows to add a Digest with a new digest algorithm to the current DigestDocument. Overwrites the previous digest if the same DigestAlgorithm is provided.
      Parameters:
      digest - Digest for the current document
    • save

      public void save(String filePath) throws IOException
      Description copied from interface: DSSDocument
      Save the content of the DSSDocument to the file.
      Specified by:
      save in interface DSSDocument
      Overrides:
      save in class CommonDocument
      Parameters:
      filePath - the path to the file to be created
      Throws:
      IOException - if any IO error happens
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class CommonDocument
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class CommonDocument