com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class SignatureField

    • Constructor Detail

      • SignatureField

        public SignatureField(Page page,
                              Rectangle rect)

        Initializes new instance of the SignatureField class.

        Parameters:
        page - Page where signature field should be placed.
        rect - Position and size of signature field.
      • SignatureField

        public SignatureField(IDocument doc,
                              Rectangle rect)

        Initializes new instance of the SignatureField class.

        Parameters:
        doc - Page where signature field should be placed.
        rect - Position and size of signature field.
    • Method Detail

      • 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 object
      • sign

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

        Signs the document using this signature field.

        Parameters:
        signature - Signature object, see PKCS1, PKCS7, PKCS7Detached.
        pfx - Stream with certificate.
        pass - Password to access private in the pfx.
      • sign

        public void sign(Signature signature)

        Sign the document using this signature field.

        Parameters:
        signature - Signature object, see PKCS1, PKCS7 and PKCS7Detached.
      • clear

        public void clear()

        Removes signature object from field.

        Overrides:
        clear in class Field
      • extractImage

        public InputStream extractImage(ImageType format)

        Extracts signature's image as encoded stream.

        Parameters:
        format - Image format for encoding.
        Returns:
        If image was successfully found than returns encodedstream object; otherwise, null.
      • extractImage

        public InputStream extractImage()

        Extracts signature's image as jpeg encoded stream.

        Returns:
        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:
        If certificate was found returns X.509 single certificate; otherwise, null.