react-native-rsa-native
react-native-rsa-native copied to clipboard
RSA.verify null is not an object
Possible Unhandled Promise Rejection (id: 0): TypeError: null is not an object (evaluating '_reactNativeRsaNative.RSA.verify')
I'm trying to verify with publicKey if a signature signed with privateKey is trusted.
The signature is RSA PKCS#1v1.5 SHA 256.
RSA.verify(signature, payload, publicKey).then( ... )
This should be correct regarding documentation.
Thanks in advance.
@crafterm any solution ?
same problem with RSA.decode
i ditched expo and recreated my project with react native cli. problem gone.
Not sure but I think the README documentation and the actual library are different:
export function verify(data: string, secretToVerify: string, key: string): Promise<boolean>;
vs what is in the README
static verify(signature : string, message : string, keyTag : string) : Promise<boolean>
Given this and my little knowledge on how to verify signatures, I am confused on how to make it work as it says in the documentation since the actual library differs from the params that you're supposed to send.
itched expo and recreated my project with react native cli. problem gone.
Yes, for me too. The problem I find is with the random byte generation in expo. The vast majority of libraries do not support applications using Expo.
For my specific problem, the solution was this library: pagarme-card-hash. No more problems with RSA.