Class P7M

java.lang.Object
com.logicaldoc.util.io.P7M

public class P7M extends Object
Use this class to read data from a .p7m file that a signed file
Since:
4.5
Author:
Matteo Caruso - LogicalDOC
  • Constructor Details

  • Method Details

    • read

      public void read(byte[] content)
    • read

      public void read(InputStream is) throws IOException
      Reads a p7m file from a stream. Sets the signed data with the stream as content.
      Parameters:
      is - The inputStream
      Throws:
      IOException - I/O error
    • read

      public void read() throws IOException
      Reads a p7m file from a file.
      Throws:
      IOException - I/O error
    • extractOriginalFileStream

      public InputStream extractOriginalFileStream() throws IOException, org.bouncycastle.cms.CMSException
      Extracts the original file content as stream
      Returns:
      the stream representing the enclosed file
      Throws:
      org.bouncycastle.cms.CMSException - in case the enclosed file cannot be extracted
      IOException - I/O error
    • extractOriginalFile

      public void extractOriginalFile(File outFile) throws IOException, org.bouncycastle.cms.CMSException
      Extracts the original file content into the given file
      Parameters:
      outFile - The file in which will contained the original file content.
      Throws:
      IOException - I/O exception
      org.bouncycastle.cms.CMSException - in case the embedded file cannot be extracted
    • getFile

      public File getFile()
    • setFile

      public void setFile(File file)
    • getCms

      public org.bouncycastle.cms.CMSSignedData getCms()