Op 21/10/2013 13:09, Bapuji Nakka schreef: > Hi, > > How world can see the document. what was the problem in the code? > Please correct me if I am understanding it wrongly.
Please show me in which line you ENCRYPT the document. Maybe I'm overlooking it. I see that you SIGN the document, this means that you add extra info to the document, among others a hash of the document bytes that is encrypted using a private key, along with the public key that is needed to decrypt that hash. > If i encrypt the document with certificate(private key) then how > user decrypt it? ??? Encrypting something with a private key is called signing. Every user can decrypt such a document using your public key. Your public key is supposed to be... PUBLIC, which means the whole world should have access to it. As far as I understand your question, you want to protect the contents of a document. In this case, you are going to ask the public key of the user(s) for whom the document is intended. You are going to encrypt the document using th(os)e public key(s) and only the people who have a private key that matches with (one of) the public key(s) will be able to decrypt the document. It goes without saying that these users should keep their private key private. > If i share public key, how user will decrypt it? This question is invalid. If you sign using a private key, the public key is stored inside the signature. If you encrypt, you don't share your public key, the user shares his public key for you to use it in the encryption process. > Do i need to provide the utility/web access to do this job. it is > not possible in my environment. ??? > what is the best certificate encryption algorithm to follow? That's a legitimate question, but you need to make up your mind first: are you talking about encryption or about signing? Because some algorithms are considered better for signing and some are considered better for encryption. ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php