Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publicEncrypt TypeError: Cannot convert null value to object, #70

Open
eramudeep opened this issue Mar 30, 2023 · 0 comments
Open

publicEncrypt TypeError: Cannot convert null value to object, #70

eramudeep opened this issue Mar 30, 2023 · 0 comments

Comments

@eramudeep
Copy link

"react": "~18.0.0",
"react-native": "~0.70.6",

import crypto  from 'react-native-crypto';
import Buffer from 'buffer'

export function EncryptTheKeyWithRSA() { 
  const publicKey = "MIIBIjANBgkqhkiG9w0BAnhtgAmhKl3E"   
  const aesKey =   crypto.randomBytes(256).toString('hex')); 
  const { Buffer: { from } } = Buffer
  
  const encryptedAesKey = crypto.publicEncrypt(publicKey,   from(aesKey) );    
}

Getting TypeError: Cannot convert null value to an object,

Any help would be appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant