Class 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
    • Method Detail

      • read

        public void read​(byte[] content)
      • read

        public void read​(InputStream is)
        Reads a p7m file from a stream. Sets the signed data with the stream as content.
        Parameters:
        is - The inputStream
      • read

        public void read()
                  throws Exception
        Reads a p7m file from a file.
        Throws:
        Exception - if the file cannot be read
      • extractOriginalFileStream

        public InputStream extractOriginalFileStream()
                                              throws Exception
        Extracts the original file content as stream
        Returns:
        the stream representing the enclosed file
        Throws:
        Exception - in case the enclosed file cannot be extracted
      • extractOriginalFile

        public void extractOriginalFile​(File outFile)
                                 throws Exception
        Extracts the original file content into the given file
        Parameters:
        outFile - The file in which will contained the original file content.
        Throws:
        Exception - 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()