Any directions on how to deal with this scenario: I have one web app that needs to upload a local file (not yet signed, a text file, for example), than sign it locally (so one applet) using the private key stored in a token/smart card owned by the writer of the text file (java stuff/api/etc) and finally do the HTTP(S)/POST to my choosen servlet?
if I do not have to write the applet by myself it would be better :), so I am looking for something (open source or not, since there must be some trickery here and there) that can just do the "whole thing" at the client side (browser) for me in the cleanest way, for instance: Open the dialog for the user to choose the file to be signed; choosing the certificate from the token/smartcard; enveloping (effectivelly signing) the original document in a signed XML and finally doing the HTTP/HTTPS POST to my servlet.