iText supports visible and invisible signing using the following modes:

Self signed (Adobe.PPKLite)

VeriSign plug-in (VeriSign.PPKVS)

Windows Certificate Security (Adobe.PPKMS)

Signing and verifying with iText is easy, and it's always done the same way, the difficult part comes with the key and certificate generation. This is a quick guide and doesn't replace the know how you should have on cryptography to make the best use of the technology.

In addition to signing the documents can be certified. Any change to the document that goes against the certification level will make it lose the certified status. The certification level can be: NOT_CERTIFIED, CERTIFIED_NO_CHANGES_ALLOWED, CERTIFIED_FORM_FILLING and CERTIFIED_FORM_FILLING_AND_ANNOTATIONS. To certify a document sign it as in the previous example but add

Signing as just described will invalidate any existing signatures in the document. To add another signature a new revision is needed. To create a new revision just create the PdfStamper the following way and do the rest as already explained:

Answer the questions and at the end you have a self signed certificate at keystore.ks. You can omit the -dname option but dont't forget to put the 2 letter country code when asked to. You can now sign the document with:

The Acrobat VeriSign plug-in (that you can get here) will only work with VeriSign certified keys but the Microsoft Windows Certificate will work with any trusted certificate and in addition to the VeriSign certificate you can also use a free Thawte certificate found at https://www.thawte.com/email/index.html.

After going through all the CA instructions you'll end up with a certificate in your IE. You'll have to export the private key including all the certificated in the certification path. The result is a .pfx file with your private key that can be used to sign the documents.

// Set the nonce. It allows the client to verify the timeliness// of the response when no trusted local clock is available.Random rand = new Random(new Date().getTime());tsq.setNonce(BigInteger.valueOf(rand.nextLong()));

// Request that the TSA signer certificate be included in the TimeStampToken.// This allows a TimeStampToken signature to be verified without an// external TSA certificate.tsq.setCertReq(true);

// Set the request policy under which this TimeStampToken should be issued.tsq.setReqPolicy(new PolicyIdentifier(PolicyIdentifier.serviceClass));

// Send the request to the Trusted Time StampServer// and get the response (an encoded TimeStampToken)TimeStampServerTCP tss = new TimeStampServerTCP("dse200 address");byte[] encodedTST = tss.submitRequest(encodedTSQ, REQUEST_TIMEOUT);// Decode the token to access the contained informationTimeStampToken tst = new TimeStampToken(encodedTST);

PdfDictionary dic2 = new PdfDictionary();dic2.put(PdfName.CONTENTS, new PdfString(encodedTST).setHexWriting(true));dic2.put(PdfName.M, new PdfDate(cal));dic2.put(PdfName.NAME, new PdfString(sn));sap.close(dic2);

This example allows the signing with smartcards. The signing is done using the Windows mode and includes the hash in the signature. This example requires .NET 1.1 and CAPICOM 2.0 as a COM Interop (select the CAPICOM as a reference and Visual Studio will create the C# interfaces and classes).

This example allows the signing with smartcards. Two functions are provided: SignHashed() signs using the Windows mode and includes the hash in the signature and SignDetached() signs in detached mode but needs more memory to do it. This example requires .NET 2.0.

// Sign the message with the private key of the signer.static public byte[] SignMsg(Byte[] msg, X509Certificate2 signerCert, bool detached) { // Place message in a ContentInfo object. // This is required to build a SignedCms object. ContentInfo contentInfo = new ContentInfo(msg);

Although a lots of code is involved in the post but surely I'll try to use it a i need to sign the PDFs using iText and iTextSharp.moreover my performance measures will be calculated on successfully completing this assignment given at officeelectronic signatures