Package com.logicaldoc.util.io
Class P7M
java.lang.Object
com.logicaldoc.util.io.P7M
Use this class to read data from a .p7m file that a signed file
- Since:
- 4.5
- Author:
- Matteo Caruso - LogicalDOC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidextractOriginalFile(File outFile) Extracts the original file content into the given fileExtracts the original file content as streamorg.bouncycastle.cms.CMSSignedDatagetCms()getFile()voidread()Reads a p7m file from a file.voidread(byte[] content) voidread(InputStream is) Reads a p7m file from a stream.void
-
Constructor Details
-
P7M
-
P7M
- Throws:
IOException
-
P7M
public P7M(byte[] content)
-
-
Method Details
-
read
public void read(byte[] content) -
read
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
Reads a p7m file from a file.- Throws:
IOException- I/O error
-
extractOriginalFileStream
public InputStream extractOriginalFileStream() throws IOException, org.bouncycastle.cms.CMSExceptionExtracts 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 extractedIOException- I/O error
-
extractOriginalFile
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 exceptionorg.bouncycastle.cms.CMSException- in case the embedded file cannot be extracted
-
getFile
-
setFile
-
getCms
public org.bouncycastle.cms.CMSSignedData getCms()
-