Class PTEID_PDFSignature


  • public class PTEID_PDFSignature
    extends java.lang.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
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addToBatchSigning​(java.lang.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

      void addToBatchSigning​(java.lang.String input_path, boolean last_page)  
      void delete()  
      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.
      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
      java.lang.String getCertificateCitizenID()  
      java.lang.String getCertificateCitizenName()  
      java.lang.String getOccupiedSectors​(int page)
      Deprecated.
      - method related to visible signature using sectors
      int getOtherPageCount​(java.lang.String input_path)  
      int getPageCount()  
      boolean isLandscapeFormat()  
      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
      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​(java.lang.String input_path)
      Set the PDF file to sign - it can be supplied either with this method or through the class constructor
      void setSignatureLevel​(PTEID_SignatureLevel arg0)  
      • Methods inherited from class java.lang.Object

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

      • PTEID_PDFSignature

        public PTEID_PDFSignature()
      • PTEID_PDFSignature

        public PTEID_PDFSignature​(java.lang.String input_path)
    • Method Detail

      • delete

        public void delete()
      • setFileSigning

        public void setFileSigning​(java.lang.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​(java.lang.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​(java.lang.String input_path,
                                      boolean last_page)
      • getPageCount

        public int getPageCount()
      • getOtherPageCount

        public int getOtherPageCount​(java.lang.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
      • 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 java.lang.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 java.lang.String getCertificateCitizenName()
      • getCertificateCitizenID

        public java.lang.String getCertificateCitizenID()