Skip to content

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

@eramudeep

Description

@eramudeep

"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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions