Summary: Ctors | Methods | Inherited Methods | [Expand All]
public class

# SignatureHandler

extends Object

java.lang.Object
↳ | com.pdftron.sdf.SignatureHandler

## Class Overview

A base class for SignatureHandler. SignatureHandler instances are responsible for defining the digest and cipher algorithms to sign and/or verify a PDF document. SignatureHandlers are added to PDFDoc instances by calling the PDFDoc.AddSignatureHandler method.

## Summary

Public Constructors
| SignatureHandler()

Public Methods
void | appendData(byte[] data) Adds data to be signed.
byte[] | createSignature() Calculates the actual signature using client implemented signing methods.
String | getName() Gets the name of this SignatureHandler.
boolean | reset() Resets any data appending and signature calculations done so far.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public SignatureHandler ()

## Public Methods

#### public void appendData (byte[] data)

Adds data to be signed. This data will be the raw serialized byte buffer as the PDF is being saved to any stream.

##### Parameters

data | A chunk of data to be signed.

##### Throws

PDFNetException |

#### public byte[] createSignature ()

Calculates the actual signature using client implemented signing methods. The returned value (byte array) will be written as the /Contents entry in the signature dictionary.

##### Returns

- The calculated signature data.

##### Throws

PDFNetException |

#### public String getName ()

Gets the name of this SignatureHandler. The name of the SignatureHandler is what identifies this SignatureHandler from all others. This name is also added to the PDF as the value of /Filter entry in the signature dictionary.

##### Returns

- The name of this SignatureHandler.

##### Throws

PDFNetException |

#### public boolean reset ()

Resets any data appending and signature calculations done so far. This method should allow PDFNet to restart the whole signature calculation process. It is important that when this method is invoked, any data processed with the AppendData method should be discarded.

##### Returns

- True if there are no errors, otherwise false.

##### Throws

PDFNetException |