org.apache.pdfbox.pdmodel.interactive.digitalsignature

## Class SigningSupport

- java.lang.Object
- - org.apache.pdfbox.pdmodel.interactive.digitalsignature.SigningSupport

All Implemented Interfaces:
  Closeable, AutoCloseable, ExternalSigningSupport

    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 and Description
`SigningSupport(COSWriter cosWriter)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`InputStream` `getContent()` Get PDF content to be signed.
`void` `setSignature(byte[] signature)` Set CMS signature bytes to PDF.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SigningSupport

    public SigningSupport(COSWriter cosWriter)

### Method Detail

#### getContent

    public InputStream getContent()
                           throws IOException

Description copied from interface: `ExternalSigningSupport`
Get PDF content to be signed. Obtained InputStream must be closed after use.

Specified by:
  `getContent` in interface `ExternalSigningSupport`
Returns:
  content stream
Throws:
  `IOException` - if something went wrong

#### setSignature

    public void setSignature(byte[] signature)
                      throws IOException

Description copied from interface: `ExternalSigningSupport`
Set CMS signature bytes to PDF.

Specified by:
  `setSignature` in interface `ExternalSigningSupport`
Parameters:
  `signature` - CMS signature as byte array
Throws:
  `IOException` - if exception occurred during PDF writing

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Throws:
  `IOException`