Closed KenV1040 closed 4 years ago
I'll try to figure out a way to do this. Right now, I think JSON string encoding/decoding might be the easiest way to do this, but I'll take a look at PEM, since PEM is more standardized.
Alright, thanks for the suggestion. I'll check it out!
Right, so I can definitely make PEM encoding work. I'm unit testing now, but PEM encoding will be in the main lib within the next few hours.
The update (which is not on github yet, I have some versioning stuff to work out) is now on pub. To convert a key to a PEM string, use
RsaCrypt().encodeKeyToString(RsaAsymmetricKey KeyHere)
To get a key back from a PEM string, use
RsaCrypt().parseKeyFromString(String PemStringHere)
After having read the documentation, I don't think you have a method to encode public and private key to PEM and storing it as a string. Is it possible to add this? I'd like to use this feature so I can store it in FlutterSecureStorage since it only accepts strings.