Conversation
Calling key.toJSON() creates an object that is serializable with: ```javascript JSON.stringify(key.toJSON()) ``` The RSA key can be recreated using: ```javascript RSA.parse(JSON.parse(rsaString)) ```
There was a problem hiding this comment.
Trailing comma, the compiler.jar rejects this.
|
As implemented in this PR, RSA.parse(rsaString)Took me a moment to realize this, so perhaps this note will help someone else. |
|
Fantastic! Thanks so much. Got stuck on this aspect in a project and this solved it. |
|
This is awesome, really helped me out! why isn't it in the official file? |
|
👍 This is awesome. helped me out with a case where I wanted to encrypt at one location and decrypt elsewhere without sharing the pass phrase |
|
Can we pull this in? I'd really like to store the key in my application without sharing the passphrase |
|
it seems merged somehow, this PR can be clossed |
|
coool! but its realy hard to find. |
|
This repo is behind the npm distribution? That's exactly the kind of thing I don't want in an npm package offering security.... edit: ended up using web crypto, I needed symmetric encryption too https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto |
I didn't notice a way to serialize an RSAKey object, so I created the following.
Thoughts?
Calling key.toJSON() creates an object that is serializable with:
The RSA key can be recreated using: