I have to digitally sign PDF from a smart card . The problem is that smart card is at the client and Files are on the server . I have searched a lot but found nothing helpful . Now I want to do it with these steps .
- Calculate the Hash of PDF
- Send it to client .
- Get the Certificate and Private key on the client with the Applet and sign the hash
- Send back the signed hash to the server
- Attach the signature to the PDF .
I am using iText Lib for signing . But It's setCrypto method requires certificate , that i don't have at server and without preclosing the PDF I can't calculate the hash . I have also used signing with external digest but this piece of code doesn't even sign the document.
If anyone can help me out.