I'm new to digital signature.
I want to create an example.
After lots of research I found this code:
iText part3/chapter12 Signatures.java
But due to my lack of knowledge, I can't figure out and make my own resource.
Is there any way to find resources which define in this code.
So I can directly execute it and examine the result and understand it?
If you go to the "learn" page on the official iText site, you will find a link to a free ebook entitled Digital Signatures for PDF Documents.
All the examples that are mentioned in this book are available on SourceForge. Most of these examples (not all of them, due to differences inherent to the different programming languages) are ported to C# and also published on SourceForge.
As for the examples from Chapter 12 of iText in Action - Second Edition. You can still find them on the book page, but they have been adapted to the most recent specifications with respect to digital signatures. The iText in Action books are more than 5 years old. The digital signatures created using the original examples are no longer supported. They aren't compliant with the PAdES standard and they will be deprecated in PDF 2.0.
I am chairing a sub-committee of the ISO committee responsible for ISO-32000-2 (aka PDF 2.0, due in 2016). Yesterday, we finalized the section regarding digital signatures. I can confirm that PKCS#1 signatures and the subfilters adbe.x509.rsa_sha1
and adbe.pkcs7.sha1
are deprecated (as in: you should no longer use them).