Class SigningSupport
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.interactive.digitalsignature.SigningSupport
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ExternalSigningSupport
public class SigningSupport extends java.lang.Object implements ExternalSigningSupport, java.io.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 void
close()
java.io.InputStream
getContent()
Get PDF content to be signed.void
setSignature(byte[] signature)
Set CMS signature bytes to PDF.
-
-
-
Field Detail
-
cosWriter
private COSWriter cosWriter
-
-
Constructor Detail
-
SigningSupport
public SigningSupport(COSWriter cosWriter)
-
-
Method Detail
-
getContent
public java.io.InputStream getContent() throws java.io.IOException
Description copied from interface:ExternalSigningSupport
Get PDF content to be signed. Obtained InputStream must be closed after use.- Specified by:
getContent
in interfaceExternalSigningSupport
- Returns:
- content stream
- Throws:
java.io.IOException
- if something went wrong
-
setSignature
public void setSignature(byte[] signature) throws java.io.IOException
Description copied from interface:ExternalSigningSupport
Set CMS signature bytes to PDF.- Specified by:
setSignature
in interfaceExternalSigningSupport
- Parameters:
signature
- CMS signature as byte array- Throws:
java.io.IOException
- if exception occurred during PDF writing
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-