JPedal supports PAdES Baseline Level B signatures.
Prerequisites
To digitally sign a PDF file using JPedal, you must have a keystore that meets the following requirements:
- The keystore must be a PKCS #12 file containing your private key and X.509 certificate
- The certificate must be valid
- The certificate signature algorithm used must be SHA256 with RSA
- The private key usage must include digitalSignature
Sign PDF Files in Java
Static Convenience Methods
PdfSigner.signPdf(
"inputFile.pdf",
"outputFile.pdf",
"keystorePassword",
"keystoreFile.p12",
"signerName",
"signerLocation",
"signingReason",
ACCESS_PERMISSION.P1);
Signing Parameters:
inputis the file location of the PDF document to be signedoutputis the file location of the PDF document after it has been signedpasswordis the password for the keystorekeystoreis the file location of the keystorenameis the person/business signing the documentlocationis the real-world location of where the document is being signedreasonis the reason for signing the documentpermissionsis the document access permission level
Document Access Permission Levels:
P1No changes are allowed otherwise the signature is invalidatedP2No changes are allowed except filling in forms, instantiating page templates, and signingP3Includes the allowed changes from level 2, as well as annotation creation, deletion, and modification