tradle / react-native-crypto

partial implementation of node's `crypto` for react-native
MIT License
372 stars 85 forks source link

Unable to use 'crypto.constants.RSA_PKCS1_OAEP_PADDING' #68

Open ahadtechcarrot opened 2 years ago

ahadtechcarrot commented 2 years ago

Hi,

I have setup the react-native-crypto library and everything is working fine, but I wanted to use crypto.constants.RSA_PKCS1_OAEP_PADDING in const encryptedData = crypto.publicEncrypt( { key: publicKey, padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, oaepHash: "sha256", }, Buffer.from(textData) );

which is not working and throwing exception and if I comment it out then it will generate a new encrypted value on every call. Can someone help me regarding this issue?

umarrasheedmebest commented 1 year ago

I'm getting the same error were you @ahadtechcarrot able to resolve this?

ahadtechcarrot commented 1 year ago

No, I am using another library for RSA Encryption - react-native-simple-crypto