title: How to Sign PDF using USB Token in Web Application?
body: <p>I want to Sign the PDF when user upload the File using USB Token which is in Client Machine in asp.net Web application.</p>
  
  <p>I am following earlier SO Post <a href="https://stackoverflow.com/questions/13204940/sign-pdf-with-itextsharp-5-3-3-and-usb-token">Sign PDF with iTextSharp 5.3.3 and USB token</a></p>
  
  <p>It works well,when I do locally when I publish it to Web Server it gives exception of <strong>The current session is not interactive.</strong></p>
  
  <p>Stack Trace:</p>
  
  <blockquote>
    <p>[InvalidOperationException: The current session is not interactive.]</p>
    
    <p>System.Security.Cryptography.CAPI.CryptUIDlgSelectCertificateW(CRYPTUI_SELECTCERTIFICATE_STRUCTW
    csc) +345679<br>
    System.Security.Cryptography.X509Certificates.X509Certificate2UI.SelectFromStore(SafeCertStoreHandle
    safeSourceStoreHandle, String title, String message, X509SelectionFlag
    selectionFlags, IntPtr hwndParent) +314<br>
    System.Security.Cryptography.X509Certificates.X509Certificate2UI.SelectFromCollectionHelper(X509Certificate2Collection
    certificates, String title, String message, X509SelectionFlag
    selectionFlag, IntPtr hwndParent) +176<br>
    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<br>
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +138<br>
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String
    eventArgument) +150    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +6047</p>
  </blockquote>
  
  <p>I am doing digital Signing of PDF First time. Kindly suggest what is the way to sign PDF in web application while Uploading.</p>