I'm signing a document with a PFX file.
The PDF is showing a yellow tick mark in the "Signature" panel, with a message :
"signer's identity is unknown because it has not been included in your list of trusted certificates and none of its parent certificates are thrusted certificates"
The PFX provider belongs to the European Trusted List (EUTL), and is in my trusted list in adobe(screenshot attached)
certutil show 3 certificates in the pfx, include a root one. (screenshot attached)
In the PDF the certificate show only my own certificate and not the chain. (screenshot attached)
The code to perform the signing is the following :
- Code: Select all
// load document
PdfDocument document = new PdfDocument();
document.loadFromStream(is);
// load certificate (pfx file)
pdfCertficat = getCertificate(certificateFile, certificatePassword, responses);
if (pdfCertficat == null) {
return responses;
}
// sign the PDF
PdfSignature signature = new PdfSignature(document,
document.getPages().get(document.getPages().getCount() - 1), pdfCertficat, signerName);
// manage the timestamp
signature.configureTimestamp("http://timestamp.digicert.com");
signature.configureHttpOCSP(null, null);
// Set the document permission to forbid changes
signature.setDocumentPermissions(PdfCertificationFlags.Forbid_Changes);
signature.setCertificated(true);
additional informations:
- Java - version 21.0.6 by Eclipse Adoptium
spire.pdf for java- version 11.3.5 by E-iceblue Co., Ltd