rakhi sinha wrote:I have generared pdf using itext in servlet.Now I want to use digital signature in that pdf.So what should I do to generate digitally signed pdf..
Tim Moores wrote:What does the question mark mean? Possibly the same as in a browser, that it's a self-signed certificate? Haver you tried a proper certificate?
Tim Moores wrote:That's a different issue that has nothing to do with PDFs; let's keep this thread to that particular problem. I would suggest that it's much easier to get this kind of thing working in a desktop app before you embed it into a web app.
I am getting a.pdf as output with signature having question mark ,how to show the green right mark on this .
Tim Moores wrote:I thought the problem was this:
I am getting a.pdf as output with signature having question mark ,how to show the green right mark on this .
Are you saying the same code -when running as part of a desktop app- does not have this problem?
Tim Moores wrote:Then it would seem that desktop app and web app do not create byte-for-byte identical PDFs; is that correct?
rakhi sinha wrote:
Tim Moores wrote:Then it would seem that desktop app and web app do not create byte-for-byte identical PDFs; is that correct?
actually i am not getting how to use certificate to create digital signature in web application,where to store digital signature to create the different different pdfs digitally signed by different different persons.
Tim Moores wrote:Where do you see the difference between using a certificate in a desktop app (which you said you have done successfully), and using a certificate in a web app?
I have removed that error but now it is giving following error. in resources folder i have saved the keystore and pdf(on which i want digital signature)Tim Moores wrote:That's a servlet problem that has nothing to do with the actual issue. Your servlet apparently does not have a doGet method, but you're accessing it using a GET.
Tim Moores wrote:Looks like you're using a relative path; that won't work in a web app - use an absolute path instead.
Tim Moores wrote:C:/Program Files/Java/jdk1.6.0/bin/.keystore is an absolute path
bin/.keystore is a relative path (relative to some other directory, that is).
Searching for "absolute path" will find more information.
we cannot give whole bin path
Tim Moores wrote:
we cannot give whole bin path
Indeed, you shouldn't do that, You should use the path into your web app. ServletContext.getRealPath can help you figure out what that is.
Tim Moores wrote:What have you tried? If you haven't tried anything, what have you read, and what ideas have you had?
rakhi sinha wrote:
Tim Moores wrote:What have you tried? If you haven't tried anything, what have you read, and what ideas have you had?
I have tried getRealPath but it is not working
Tim Moores wrote:You're again using a relative path; two, actually, one in each line of code. The difference is that an absolute path that's used in conjunction with a servlet context is anchored to that context's root - it starts with "/".
Tim Moores wrote:With all due respect - I sincerely doubt that. Is "LoginExample" the name of the servlet context? If so, it should not be part of the path. And the file path needs to be absolute, as I mentioned several times by now.
Tim Moores wrote:Post the code you're now using and the text of the exception. Also describe the layout of the files and directories that are involved.
Tim Moores wrote:It looks like you still don't understand the concept of paths, neither of file systems paths, nor of paths within a web app. I suggest you get more familiar with those before applying them to this problem.
Or do you really have a root directory called "resources" on your disk?
Or a directory called "resources" at the top level of your web app?
rakhi sinha wrote:
Tim Moores wrote:It looks like you still don't understand the concept of paths, neither of file systems paths, nor of paths within a web app. I suggest you get more familiar with those before applying them to this problem.
Or do you really have a root directory called "resources" on your disk?
Or a directory called "resources" at the top level of your web app?
resources is at the top level of web app
Or do you really have a root directory called "resources" on your disk?
Tim Moores wrote:This part of the question still stands:
Or do you really have a root directory called "resources" on your disk?
It's the FileOutputStream handling where the exception occurs, after all.
Tim Moores wrote:As I said, there's no difference to using certificates in a desktop app. You just need to fix the exceptions resulting from files not being where they should be, or the paths you're using being incorrect.
If you're still getting exceptions, post the relevant code excerpts along with the full exception stack trace, and describe to us fully the layout of your files and directories.
Hey! You're stepping on my hand! Help me tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|