PdfSignature dic = new PdfSignature(PdfName.ADOBE_PPKLITE, Sap.SetCrypto( null, this.m圜ert.Chain, null, PdfSignatureAppearance.SELF_SIGNED)
Below is a piece of code from the new Sign() method implementing the self signed document signature type: Using this option gives us more control on the signature process, but then we need to calculate the signature digest. To support TSA, we need to use the SELF_SIGNED signature type. This method is easier to implement because iTextSharp does all the signature jobs, but this option doesn't allow TSA support. The old Sign method used a WINCER_SIGNED signature type. Please refer to my first article (" E-signing PDF documents with iTextSharp") to read the description of a simpler Sign method version (without encryption and timestamp). The most important method in the code is the Sign method. You can get the latest source code version from the iSagePDF official site. It also allows you to open and read the document.
The owner password allows you to modify encryption options using iSagePDF or another PDF manipulation program.
The user password allows you to open and read the document, plus do what encryption allows you to do. Here, you can choose to activate or not the document encryption if encryption is active, you need to enter two passwords.
No setup is needed, all you have to do is to uncompress the zip file and put the exe program somewhere in your disk and then run it. This article comes with the iSafePDF binary.
this mean that any PDF viewer will be able to read encrypted document (if you provide the encryption password) and check signature without the need to install 3rd party plugin or so. What you have to know, is that PDF digital signature and encryption provided by iTextSharp library are all PDF standards. It describes an old and simple code (the base code of iSafePDF) which is easier to understand. You can read my first article about digital signature " E-signing PDF documents with iTextSharp". I developed iSafePDF for my own needs and tried to implement features that many people asked for: loading certificates from a local user store, time-stamped signature, and PDF encryption (only password encryption is supported right now). iTextSharp is more than this, it allows you to create and manipulate PDF without using any proprietary library! This article will only cover the digital signature, encryption, and meta-data manipulation parts. Now iTextSharp v5.x is out and comes with many new features.
Four years ago, I wrote an article about signing a PDF document using the iTextSharp library.