I want to Sign the PDF when user upload the File using USB Token which is in Client Machine in asp.net Web application.
I am following earlier SO Post Sign PDF with iTextSharp 5.3.3 and USB token
It works well,when I do locally when I publish it to Web Server it gives exception of The current session is not interactive.
Stack Trace:
[InvalidOperationException: The current session is not interactive.]
System.Security.Cryptography.CAPI.CryptUIDlgSelectCertificateW(CRYPTUI_SELECTCERTIFICATE_STRUCTW csc) +345679
System.Security.Cryptography.X509Certificates.X509Certificate2UI.SelectFromStore(SafeCertStoreHandle safeSourceStoreHandle, String title, String message, X509SelectionFlag selectionFlags, IntPtr hwndParent) +314
System.Security.Cryptography.X509Certificates.X509Certificate2UI.SelectFromCollectionHelper(X509Certificate2Collection certificates, String title, String message, X509SelectionFlag selectionFlag, IntPtr hwndParent) +176
System.Security.Cryptography.X509Certificates.X509Certificate2UI.SelectFromCollection(X509Certificate2Collection certificates, String title, String message, X509SelectionFlag selectionFlag) +17 test.WebForm1.Upload_Click(Object sender, EventArgs e) in E:\manishtest\test\test\WebForm1.aspx.cs:74
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +138
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6047
I am doing digital Signing of PDF First time. Kindly suggest what is the way to sign PDF in web application while Uploading.