SignatureField

Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph, com.aspose.pdf.Annotation, com.aspose.pdf.WidgetAnnotation, com.aspose.pdf.Field

public final class SignatureField extends Field

Represents signature form field.

Constructors

ConstructorDescription
SignatureField(Page page, Rectangle rect)Initializes new instance of the SignatureField class.
SignatureField(IDocument doc, Rectangle rect)Initializes new instance of the SignatureField class.

Methods

MethodDescription
getSignature()Gets signature object.
sign(Signature signature, InputStream pfx, String pass)Signs the document using this signature field.
sign(Signature signature)Sign the document using this signature field.
clear()Removes signature object from field.
extractImage(ImageType format)Extracts signature’s image as encoded stream.
extractImage()Extracts signature’s image as jpeg encoded stream.
extractCertificate()Extracts the single X.509 certificate in DER format as a stream.

SignatureField(Page page, Rectangle rect)

public SignatureField(Page page, Rectangle rect)

Initializes new instance of the SignatureField class.

Parameters:

ParameterTypeDescription
pagePagePage where signature field should be placed.
rectRectanglePosition and size of signature field.

SignatureField(IDocument doc, Rectangle rect)

public SignatureField(IDocument doc, Rectangle rect)

Initializes new instance of the SignatureField class.

Parameters:

ParameterTypeDescription
docIDocumentPage where signature field should be placed.
rectRectanglePosition and size of signature field.

getSignature()

public Signature getSignature()

Gets signature object. This object contains signature data regarding public-key cryptographic standards. Classes PKCS1 , PKCS7 and PKCS7Detached represent all supported types of signature objects.

Returns: Signature - Signature object

sign(Signature signature, InputStream pfx, String pass)

public void sign(Signature signature, InputStream pfx, String pass)

Signs the document using this signature field.

Parameters:

ParameterTypeDescription
signatureSignatureSignature object, see PKCS1 , PKCS7 , PKCS7Detached .
pfxjava.io.InputStreamStream with certificate.
passjava.lang.StringPassword to access private in the pfx .

sign(Signature signature)

public void sign(Signature signature)

Sign the document using this signature field.

Parameters:

ParameterTypeDescription
signatureSignatureSignature object, see PKCS1 , PKCS7 and PKCS7Detached .

clear()

public void clear()

Removes signature object from field.

extractImage(ImageType format)

public InputStream extractImage(ImageType format)

Extracts signature’s image as encoded stream.

Parameters:

ParameterTypeDescription
formatImageTypeImage format for encoding.

Returns: java.io.InputStream - If image was successfully found than returns encodedstream object; otherwise, null.

extractImage()

public InputStream extractImage()

Extracts signature’s image as jpeg encoded stream.

Returns: java.io.InputStream - If image was successfully found than returns jpeg encoded stream object; otherwise, null.

extractCertificate()

public InputStream extractCertificate()

Extracts the single X.509 certificate in DER format as a stream.

Returns: java.io.InputStream - If certificate was found returns X.509 single certificate; otherwise, null.