Package pt.gov.cartaodecidadao
Class PTEID_PDFSignature
java.lang.Object
pt.gov.cartaodecidadao.PTEID_PDFSignature
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
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToBatchSigning(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
voidaddToBatchSigning(String input_path, boolean last_page) voiddelete()voidUse 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.voidApply 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".getOccupiedSectors(int page) Deprecated.- method related to visible signature using sectorsintgetOtherPageCount(String input_path) intbooleanvoidsetCustomImage(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" logovoidsetCustomSealSize(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 sizevoidsetFileSigning(String input_path) Set the PDF file to sign - it can be supplied either with this method or through the class constructorvoid
-
Constructor Details
-
PTEID_PDFSignature
public PTEID_PDFSignature() -
PTEID_PDFSignature
-
-
Method Details
-
delete
public void delete() -
setFileSigning
Set the PDF file to sign - it can be supplied either with this method or through the class constructor -
addToBatchSigning
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
-
getPageCount
public int getPageCount() -
getOtherPageCount
-
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
-
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
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
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
-
getCertificateCitizenID
-