Package com.logicaldoc.util.io
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 Summary
Constructors Constructor Description P7M(byte[] content)P7M(File file)P7M(InputStream is)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidextractOriginalFile(File outFile)Extracts the original file content into the given fileInputStreamextractOriginalFileStream()Extracts the original file content as streamorg.bouncycastle.cms.CMSSignedDatagetCms()FilegetFile()voidread()Reads a p7m file from a file.voidread(byte[] content)voidread(InputStream is)Reads a p7m file from a stream.voidsetFile(File file)
-
-
-
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 ExceptionReads 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()
-
-