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:
input
is the file location of the PDF document to be signedoutput
is the file location of the PDF document after it has been signedpassword
is the password for the keystorekeystore
is the file location of the keystorename
is the person/business signing the documentlocation
is the real-world location of where the document is being signedreason
is the reason for signing the documentpermissions
is the document access permission level
Document Access Permission Levels:
P1
No changes are allowed otherwise the signature is invalidatedP2
No changes are allowed except filling in forms, instantiating page templates, and signingP3
Includes the allowed changes from level 2, as well as annotation creation, deletion, and modification