Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to digitally sign a PDF(or another document) in Java?

What libraries can be used to digitally sign documents in Java?

like image 960
DFG Avatar asked Jan 23 '23 13:01

DFG


2 Answers

iText is probably the highest quality PDF manipulation library I've seen commercial or open source, and it absolutely can be used to sign PDF documents.

  • From the documentation.
  • A blog entry describing how it's done.
like image 126
cgp Avatar answered Jan 30 '23 14:01

cgp


Because PDF has explicit support for digital signatures, the process for signing them is different than what you might have to use for "another document", as pointed out already.

If you have a document format that doesn't have digital signature support "built-in", you can wrap it with in another format that supports digital signatures, such as S/MIME. BouncyCastle's S/MIME support is alright.

like image 28
erickson Avatar answered Jan 30 '23 13:01

erickson