PAdES PDF Avanced Electronic Signatures Support in Qoppa PDF SDK

Does Qoppa’s PDF API support signing using “Advanced Electronic Signatures (AdES)”, as recognized by eIDAS regulation? Qoppa’s PDF library and components currently support the following digital signature types: • PKCS7 Signatures • B-B PAdES signatures • B-T PAdES signatures Qoppa’s PDF library and components currently do not support the following types of signatures (which are […]

Read More

Merging signed PDFs with Java PDF SDK jPDFProcess

Q: When merging signed PDFs or assembling pages from signed PDFs, jPDFProcess is throwing permission exceptions. How can I get around this? A: We try to prevent operations on signed PDFs that would invalidate digital signatures in PDF documents. This is so that customers do not invalidate signatures by accident. If you do not mind […]

Read More

Add Document TimeStamp (DTS) to a PDF document with Java

Using Qoppa’s PDF library products, jPDProcess and jPDFSecure, it is possible to add a Document Time Stamp (DTS added in PDF 2.0) to a PDF document. Here is a sample java program that does so. PDFDocument doc = new PDFDocument(in, null);   // Invisible signature field SignatureField field = doc.getPage(0).addSignatureField("Signature1", new Rectangle2D.Double(0, 0, 0, 0)); […]

Read More

Can a digital signature in a PDF document have multiple linked widgets?

Q: We know that standard interactive form fields can have multiple widgets associated with them. In this case, all “linked” widgets in the document will contain the same form field data & have the same appearance stream. But how about digital signature fields? Do they allow multiple widgets to be associated with them? Answer: The […]

Read More

How to lock a PDF document when applying a digital signature in Java

Below is sample Java code showing how to lock a PDF document when applying a digital signature to it using jPDFSecure, Qoppa’s Java PDF Security SDK.   // load PDF document into jPDFSecure PDFSecure pdf = new PDFSecure("c:/test/test01.pdf", null);   // add a signature field SignatureField signField = pdf.addSignatureField(0, "sign here", new Rectangle(72, 72, 144, […]

Read More

Sign a PDF document with Java & Azure

Qoppa has 2 Java libraries that can apply signatures to a PDF document: jPDFSecure and jPDFProcess. To allow signature calculation with external signature appliances such as hardware security modules (HSM), we’ve defined a ContentSigner interface in our API, which allows our libraries to send the PDF content data to be signed externally and then receive […]

Read More

Sign a PDF document with 2 digital signatures

Here is some sample code showing how to use Qoppa’s Java PDF library jPDFSecure to apply 2 digital signatures to the same document or in other words, to sign a PDF document twice. This code can be very simply adpated to use our other library jPDFProcess and a PDFDocument object instead of a PDFSecure object. […]

Read More

Which hash algorithm is used when applying digital signatures

Qoppa’s PDF libraries components (v2020 and up) and Android PDF toolkit (v6.8 and up) use the safest hash algorithm available and supported by the PDF file version when applying digital signatures. This is priority order in which we look for hash algorithms based on the document version: PDF File Version 1.7 & up: “SHA512”, “SHA384”, […]

Read More

Resolve Error “JCE Provider does not support SHA hash algorithm”

Q: I am building a web application to sign a PDF document with a given .pfx key store. I am running Spring Boot and using Qoppa’s PDF library jPDFSecure. I am getting an exception which states “JCE Provider does not support SHA hash algorithm”. How can I resolve this error? com.qoppa.pdf.PDFException: JCE Provider does not […]

Read More

Signature hash will not fit in allotted space

When signing using PKCS7 or PAdes with a timestamp server, you might receive the following exception: com.qoppa.pdf.PDFException: Signature hash (7895 bytes) will not fit in allotted space (7500 bytes).Increase timestamp server length estimate. To resolve this issue, you can increase the length estimate when defining the timestampserver parameters (the default length is originally set to […]

Read More

Difference between PKCS11 and PKCS12

Though the names are very similar, PCKS11 and PKCS12 are actually defining 2 very different things and this can create some confusion. PKCS11 is a protocol used to access hardware encryption devices such as USB tokens, smart card or vaults (such as Azure Vault). Keystore API in Java allows to abstract access to the PKCS11 […]

Read More

Retrieving signature information from a signed PDF

This java sample program shows how to open a signed PDF and retrieve signature information from it such as signer’s name, sign reason, location, date, etc…. This sample uses Qoppa’s Java PDF Library jPDFSecure but can be easily changed to use jPDFProcess. // Load the signed document PDFSecure pdfDoc = new PDFSecure ("C:\\test\\output.pdf", null); if(pdfDoc.getSignatureFields() […]

Read More

Signing a PDF with a p12 file in Java

This is a sample java program showing how to sign a PDF document using a certificate loaded from a p12 file. The signature appearance is customized with an image, signer’s name and date. A signature field is added to the PDF document and then signed. This code uses jPDFSecure library but could very easily be adapted […]

Read More

Digital signatures and PDF/A compliance

Converting to PDF/A an existing Signed Document It is not possible to convert an existing PDF document that is already signed to PDF/A. This is because any changes that you make to a PDF even if it’s only adding PDF/A tags information in the metadata would invalidate the signature. If your PDF is already signed, […]

Read More

Clear Password and Permissions in a PDF document

It is possible to clear permissions and passwords in a PDF document using several of Qoppa’s Java PDF libraries and components. With jPDFSecure, use PDFSecure.clearPasswordPermissions() With jPDFProcess, use PDFDocument.clearPasswordPermissions() With jPDFEditor, use PDFEditorBean.getDocument().clearPasswordPermissions() Calling PDFSecure.clearPasswordPermissions will clear all password permissions for this document: it will reset all password permissions to true. it will clear open/user […]

Read More

Changing PDF Document Permissions and Passwords

It is possible to set / update permissions and passwords in a PDF document using several of Qoppa’s Java PDF libraries and components. Call to change document permissions and passwords depending on which Qoppa library you use:   // with jPDFSecure PDFSecure.setPasswordPermissions(newPermPwd, newOpenPwd, permissions, currentPermPwd, encryptType);   // with jPDFProcess PDFDocument.setPasswordPermissions(newPermPwd, newOpenPwd, permissions, currentPermPwd, encryptType); […]

Read More

Create your own pfx pkcs12 certificate to test jPDFSecure and digitally sign PDF

Here is the command line to create a pfx file with the Java keytool. This assumes that you have jdk 1.7.0_79 installed under your C:\Program Files folder. “C:\Program Files\Java\jdk1.7.0_79\bin\keytool” -genkeypair -keystore signature.pfx -storepass mypassword -storetype pkcs12 -alias myalias -dname “cn=John Smith, ou=Google, o=Google, c=US” Using the signature.pfx file generated above, you can add a digital […]

Read More

Apply a digital signature to a PDF using a custom image appearance

This Java sample code applies a digital signature to a document with a custom appearance. The appearance of signatures can be modified in jPDFSecure to include an image, choose the fields that show or custom text. /** * Qoppa Software – Sample Source Code */ package jPDFSecureSamples;   import java.awt.geom.Rectangle2D; import java.io.FileInputStream; import java.security.KeyStore;   […]

Read More

Adding custom properties to PDF digital signatures

Q: Is it possible to set custom properties to digital signatures using Qoppa’s PDF SDK? A: Yes, it is possible to do so using jPDFSecure, jPDFProcess or qPDF Toolkit. Adding custom property to the signature dictionary This method can be used to add additional custom properties to the signature dictionary. SigningInformation.setCustomProperty(key, value);SigningInformation.setCustomProperty(key, value); You can […]

Read More

jPDFSecure v2015R2 Build Notes

v2015R2.01 – March 28 2016 JPDF-733 – Sample application used a non-public class PDFEncryption.is256(): Exception occurred during event dispatching: java.lang.NoClassDefFoundError: com/qoppa/pdf/security/PDFEncryption

Read More

Trust Windows Store Certificates

Q: Can I read from the Windows Certificate store to get digital IDs to use as trusted Certificate Authorities (CAs)? A: By default, our libraries jPDFSecure and jPDFProcess and components jPDFNotes and jPDFEditor use the Java trusted Certificate Authorities when verifying digital signatures in PDF documents. It is possible to customize the trusted authorities through the SignatureSettings static methods. To add the Windows trusted CAs, […]

Read More

Multiple digital signatures on a PDF document

Q: I am using your Java library jPDFSecure to add 2 digital signatures to a PDF document (sign, save, sign again and save) but only the last signature shows as valid, the first signature is showing as invalid. Am I doing anything wrong? This KB entry applies to the following Java libraries and components: jPDFProcess, […]

Read More

jPDFSecure Java API

Q: Where can I find jPDFSecure javadoc API? A: You can find the API specification for the latest version of our library jPDFSecure on our website at this link. jPDFSecure is a java library to set permissions and passwords, encrypt and  digitally sign PDF documents.

Read More

Code Sample: Sign PDF Using Windows IDs

Windows maintains a certificate and digital ID store. Digital IDs in the store can come from certificate authorities, or can come from USB hardware tokens. Our Java libraries jPDFSecure, jPDFProcess and visual components jPDFNotes or jPDFEditor can apply a digital signature to a PDF document using a digital ID from the Windows certificate store. Here is sample java code showing how to retrieve […]

Read More