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 SummaryConstructors
- 
Method SummaryModifier 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
 
- 
P7Mpublic P7M(byte[] content) 
 
- 
- 
Method Details- 
readpublic void read(byte[] content) 
- 
readReads a p7m file from a stream. Sets the signed data with the stream as content.- Parameters:
- is- The inputStream
- Throws:
- IOException- I/O error
 
- 
readReads a p7m file from a file.- Throws:
- IOException- I/O error
 
- 
extractOriginalFileStreampublic 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 extracted
- IOException- I/O error
 
- 
extractOriginalFileExtracts 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
- 
setFile
- 
getCmspublic org.bouncycastle.cms.CMSSignedData getCms()
 
-