title: How to sign the document with a certificate's private key from the browser (CAPICOM alternative)?
body: <p>So, till Windows 7 there was a Microsoft ActiveX component: CAPICOM, which one could call from Javascript and then show the contents of the certificate storage on the client's machine. The client then could choose the appropriate certificate and sign some document with the certificate's private key. 
  That's how the access to the certificate storage looked in Javascript:</p>
  
  <pre><code>var MyStore = new ActiveXObject("CAPICOM.Store");
  var oCertificates = new ActiveXObject("CAPICOM.Certificates");
  // attempt to open the personal certificate store   
  MyStore.Open(CAPICOM_CURRENT_USER_STORE, "My", CAPICOM_STORE_OPEN_READ_ONLY);
  </code></pre>
  
  <p>What’s the alternative to using CAPICOM nowadays? I want the client to be able to sign some piece of text with his private key <strong>in the browser</strong> and then send the signed text with the public key to the server. Is it still possible?</p>
  
  <p>Maybe I could use Java or Silverlight instead of pure JavaScript? What about <strong>PKI.js</strong> and similar?</p>