title: Save RSA Key object from Cryptico.js
body: <p>I'm struggling to discover how to transform an javascript object, into some variable (array?) and save it with a code like:</p>
  
  <pre><code>function onDownload() {
      document.location = 'data:Application/octet-stream,' +
                           encodeURIComponent(RsaKey);
  }
  </code></pre>
  
  <p><strong>Why?</strong></p>
  
  <p>The library cryptico (documentation: <a href="https://github.com/wwwtyro/cryptico" rel="nofollow">github</a>) gives-me an easy to use RSA interface. But my nightmare came when the generated key pair, is an object. I don't know how to export this object from the client's browser, to a file, for later using. The public part of the key, can be converted in string, by the function</p>
  
  <blockquote>
    <p>publicKeyString</p>
  </blockquote>
  
  <p>But the private part, is inside the object. I read about the RSA algorithm and saw that the "d" is what matters in the private key, and I have the "d" in the key gen function, inside the rsa.js</p>
  
  <blockquote>
  <pre><code>        this.d = ee.modInverse(phi);
  </code></pre>
  </blockquote>
  
  <p>I tried to get this value and put into a string, but didn't worked. Don't know what else to do. Appreciate any help.</p>