E- signing PDF documents with i. Text. Sharp. An example demonstrating how to sign PDF documents with the i. Text. Sharp library. Introduction. In this article, I will present a simple source code allowing you to digitally sign a PDF document and modify its metadata. I will use the excellent and free port of i. Text library: i. Text. Sharp that can be downloaded here. Itextsharp Check If Pdf Is Signed SealedItextsharp Check If Pdf Is Signed English A LanguageProblems when using itextsharp to sign pdf documents. Problems when using > itextsharp to. After I open the file I just signed in PDF it says that the. You'll need Visual Studio 2. If you don’t know what digital signatures are or how they work, you can go here or here, or simply ask Google : )i. Text. Sharp provides a lot of interesting features to create and manipulate PDF documents, but in this article, we will only use digital signature functions. I will also use some function to manipulate PKCS#1. PKCS#1. 2 certificate. Getting started. So the first thing you have to do is to install a certificate on your browser. If you don’t have one, you can install the demo certificate from here.
You will also want to check out the new features that. Then, extract the PKCS#1. Open Internet Explorer and click on Tools, then Internet Options. Go to the 'Content' tab and click 'Certificates'. Choose a certificate from the list and click Export. Follow the wizard, and when asked, choose to include private key with the extracted certificate. Enter a password when prompted (don't give an empty one!!!)You are now ready to use the code provided in this article. Using the signature example: Compile and run the example. Browse to the PDF source file you want to sign. Browse and choose a destination PDF file. Add/modify the PDF meta data if you want. Browse to the certificate (the . Give the password you used to extract the certificate. Add signature information if needed (reason, contact, and location). Click the Sign button. In the debug box, you’ll see the operation’s progress. If everything goes well, open your explorer and browse to the location you entered for the target file, open this file with Adobe Acrobat reader, and your document is signed! It’s a helper package that uses i. Text. Sharp and doed everything you need for digital signatures. It contains three classes: Cert: this class is used to hold a certificate and extract the needed information for the signature; the most important method in this class is process. Cert (will be explained below). Meta. Data: holds the PDF metadata. PDFSigner: the construction of this class takes a Cert object and, if needed, a Meta. Data object. The most important method here is the Sign method (will be explained below). Cet methodprivatevoid process. Cert(). . It also construct the certificate's chain if available. Sign methodpublicvoid Sign(string Sig. Reason, string Sig. Contact, string Sig. Location, bool visible). PDFStamper is a PDF Writer that can sign PDF documents. The signature appearance can be configured so you can add a reason, a contact, and a location attribute to the signature. The Set. Crypto method allows us to sign the document using the private key and chain certificate we extracted from the certificate file. And finally, Set. Visible. Signature is used if you need to add a visible signature to the document. PDFReader, PDFStamper and Pdf. Signature. Appearance are provided by the i. Text. Sharp library. Well, that’s all for now : ) I hope that you found my first article useful.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |