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
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
page | Page | Page where signature field should be placed. |
rect | Rectangle | Position and size of signature field. |
SignatureField(IDocument doc, Rectangle rect)
public SignatureField(IDocument doc, Rectangle rect)
Initializes new instance of the SignatureField class.
Parameters:
Parameter | Type | Description |
---|---|---|
doc | IDocument | Page where signature field should be placed. |
rect | Rectangle | Position 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:
Parameter | Type | Description |
---|---|---|
signature | Signature | Signature object, see PKCS1 , PKCS7 , PKCS7Detached . |
pfx | java.io.InputStream | Stream with certificate. |
pass | java.lang.String | Password to access private in the pfx . |
sign(Signature signature)
public void sign(Signature signature)
Sign the document using this signature field.
Parameters:
Parameter | Type | Description |
---|---|---|
signature | Signature | Signature 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:
Parameter | Type | Description |
---|---|---|
format | ImageType | Image 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.