amitaymolko / react-native-rsa-native

A native implementation of RSA key generation and encryption/decryption.
MIT License
232 stars 112 forks source link

Updated RSA keys for Android #130

Closed nickmccomb closed 2 years ago

nickmccomb commented 2 years ago

On Android the returned keys are different to iOS. iOS = PEM / PKCS8 Android = PEM / PKCS1 This creates issues when using libraries like Jose. The public key using RSA library does not work with Jose. Specifically the function: jose.JWK.asKey e.g jose.JWK.asKey(keys.public, "pem", props)

I have updated the generateKeys method, which now returns the correct keys that work with Jose.