Class PTEID_PDFSignature

java.lang.Object
pt.gov.cartaodecidadao.PTEID_PDFSignature

public class PTEID_PDFSignature extends Object
Helper class for the PTEID_EIDCard::SignPDF() methods - it defines multiple options that affect the signature
operation e.g Signature in batch mode, adding a cryptographic timestamp, small format visible signature and custom
image in the visible signature
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a file to a batch mode signature.

    This means the signature PIN introduced when the first signature is performed
    is cached in memory for the minimum time needed to sign the complete set of files

    void
    addToBatchSigning(String input_path, boolean last_page)
     
    void
     
    void
    Use a smaller format for the visible signature which is 50% smaller in height but as wide as the regular format.
    If using a smaller format and a custom seal size at the same time the final size is 50% smaller then the current
    configured size.
    void
    Apply a timestamp after signing the document.

    Apply a cryptographic timestamp on the signature(s) - Internet connection is required.
    By default the implementation will use the official Cartão de Cidadão TSA at ts.cartaodecidadao.pt.
    Information about request limits described at https://pki.cartaodecidadao.pt - in section "Serviço de Selos
    Temporais".
     
     
    Deprecated.
    - method related to visible signature using sectors
    int
     
    int
     
    boolean
     
    void
    Change the image that's used on the bottom of the visible signature
    This image will replace the default "Cartão de Cidadão" logo
    void
    setCustomSealSize(long width, long height)
    Change the size of the visible signature (Minimum size: 120x35 px)
    Visible signature never will be smaller than page
    Except if the page is smaller then minimum size
    void
    setFileSigning(String input_path)
    Set the PDF file to sign - it can be supplied either with this method or through the class constructor
    void
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PTEID_PDFSignature

      public PTEID_PDFSignature()
    • PTEID_PDFSignature

      public PTEID_PDFSignature(String input_path)
  • Method Details

    • delete

      public void delete()
    • setFileSigning

      public void setFileSigning(String input_path)
      Set the PDF file to sign - it can be supplied either with this method or through the class constructor
    • addToBatchSigning

      public void addToBatchSigning(String input_path)
      Add a file to a batch mode signature.

      This means the signature PIN introduced when the first signature is performed
      is cached in memory for the minimum time needed to sign the complete set of files

      Parameters:
      input_path - : Absolute path for a PDF file to be signed in batch mode
    • addToBatchSigning

      public void addToBatchSigning(String input_path, boolean last_page)
    • getPageCount

      public int getPageCount()
    • getOtherPageCount

      public int getOtherPageCount(String input_path)
    • enableTimestamp

      public void enableTimestamp()
      Apply a timestamp after signing the document.

      Apply a cryptographic timestamp on the signature(s) - Internet connection is required.
      By default the implementation will use the official Cartão de Cidadão TSA at ts.cartaodecidadao.pt.
      Information about request limits described at https://pki.cartaodecidadao.pt - in section "Serviço de Selos
      Temporais". Using PTEID_Config with parameter PTEID_PARAM_XSIGN_TSAURL a different TSA may be specified
    • setSignatureLevel

      public void setSignatureLevel(PTEID_SignatureLevel arg0)
    • enableSmallSignatureFormat

      public void enableSmallSignatureFormat()
      Use a smaller format for the visible signature which is 50% smaller in height but as wide as the regular format.
      If using a smaller format and a custom seal size at the same time the final size is 50% smaller then the current
      configured size. The default "Cartão de Cidadão" logo or a custom image supplied via setCustomImage() will not be
      included.
    • isLandscapeFormat

      public boolean isLandscapeFormat()
    • getOccupiedSectors

      public String getOccupiedSectors(int page)
      Deprecated.
      - method related to visible signature using sectors
    • setCustomSealSize

      public void setCustomSealSize(long width, long height)
      Change the size of the visible signature (Minimum size: 120x35 px)
      Visible signature never will be smaller than page
      Except if the page is smaller then minimum size
      Parameters:
      width - - width of the visible signature (Minimum size: 120 px)
      height - - height of the visible signature (Minimum size: 35 px)
    • setCustomImage

      public void setCustomImage(PTEID_ByteArray image_data)
      Change the image that's used on the bottom of the visible signature
      This image will replace the default "Cartão de Cidadão" logo
      Parameters:
      image_data - - image data in JPEG format (mandatory size: 351x77 px)
    • getCertificateCitizenName

      public String getCertificateCitizenName()
    • getCertificateCitizenID

      public String getCertificateCitizenID()