cryptico icon indicating copy to clipboard operation
cryptico copied to clipboard

RSA key serialization

Open rca opened this issue 12 years ago • 9 comments

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:

JSON.stringify(key.toJSON())

The RSA key can be recreated using:

RSA.parse(JSON.parse(rsaString))

rca avatar Feb 05 '13 08:02 rca

As implemented in this PR, RSAParse already does a JSON.parse, so the example would be:

RSA.parse(rsaString)

Took me a moment to realize this, so perhaps this note will help someone else.

BinaryMuse avatar Jun 10 '13 08:06 BinaryMuse

Fantastic! Thanks so much. Got stuck on this aspect in a project and this solved it.

stephensprinkle-zz avatar Aug 04 '13 03:08 stephensprinkle-zz

This is awesome, really helped me out! why isn't it in the official file?

hawkps avatar Mar 05 '15 09:03 hawkps

:+1: 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

kitwalker12 avatar Jul 16 '15 00:07 kitwalker12

Can we pull this in? I'd really like to store the key in my application without sharing the passphrase

simkessy avatar Jan 03 '16 02:01 simkessy

are @wwwtyro and @rca interested in continuing this? i'm happy to jump in or fork and pull and maintain if not. this is really useful and all that's blocking it is an extra comma...

therightstuff avatar Oct 25 '16 09:10 therightstuff

it seems merged somehow, this PR can be clossed

beenotung avatar Dec 09 '17 23:12 beenotung

coool! but its realy hard to find.

ayazzali avatar Mar 27 '18 22:03 ayazzali

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

dansgithubuser avatar Aug 09 '19 20:08 dansgithubuser