I'm struggling to discover how to transform an javascript object, into some variable (array?) and save it with a code like:
function onDownload() {
document.location = 'data:Application/octet-stream,' +
encodeURIComponent(RsaKey);
}
Why?
The library cryptico (documentation: github) 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
publicKeyString
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
this.d = ee.modInverse(phi);
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.