Skip to content

Exception in RSA.verifyWithAlgorithm #171

@symclouds

Description

@symclouds

Hello, I'm not sure if anyone is still supporting this project but I have been using it for JWT Token validation in a react-native app. More specifically I'm using 'verifyWithAlgorithm' as follows:

try {
   const verify = RSA.verifyWithAlgorithm(signature, tokenData, pubKey, RSA.SHA256withRSA);
}
catch(error) {
   console.log(error);
   console.log("Signature String: " + signature);
   console.log("Token String: " + tokenData);
   console.log(pubKey);
}

Most of the time it works great but every now and again it throws an exception as: 'Error: error' without any additional info. Initially I was assuming that something was wrong with the parameters I was passing in (e.g. the signature of the JWT (3rd part of the . separated token), the tokenData (1st + 2nd parts of the . separated token) or the RSA public key), but every time I print the parameters on error from the catch block and validate them online they show as valid.

This is the only project I was able to find for validating JWT signature in react-native and counting on it. If there is a race condition or something like that I would be happy to help root cause. It's just that the issue is transient so I'm not sure what else to provide apart from the parameters that cause the failure. If there are additional validations of the input data I can do to have more consistency please let me know.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions