Class SigningSupport
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.digitalsignature.SigningSupport
-
- All Implemented Interfaces:
ExternalSigningSupport,Closeable,AutoCloseable
public class SigningSupport extends Object implements ExternalSigningSupport, Closeable
Class to be used when creating PDF signatures externally. COSWriter is used to obtain data to be signed and set the resulted CMS signature.
-
-
Constructor Summary
Constructors Constructor Description SigningSupport(COSWriter cosWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()InputStreamgetContent()Get PDF content to be signed.voidsetSignature(byte[] signature)Set CMS signature bytes to PDF.
-
-
-
Constructor Detail
-
SigningSupport
public SigningSupport(COSWriter cosWriter)
-
-
Method Detail
-
getContent
public InputStream getContent() throws IOException
Description copied from interface:ExternalSigningSupportGet PDF content to be signed. Obtained InputStream must be closed after use.- Specified by:
getContentin interfaceExternalSigningSupport- Returns:
- content stream
- Throws:
IOException- if something went wrong
-
setSignature
public void setSignature(byte[] signature) throws IOExceptionDescription copied from interface:ExternalSigningSupportSet CMS signature bytes to PDF.- Specified by:
setSignaturein interfaceExternalSigningSupport- Parameters:
signature- CMS signature as byte array- Throws:
IOException- if exception occurred during PDF writing
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-