How to use the react-native-rsa-native.RSA.signWithAlgorithm function in react-native-rsa-native

To help you get started, we’ve selected a few react-native-rsa-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amitaymolko / react-native-rsa-native / example / App / App.js View on Github external
const signAlgoDemo = async () => {
  console.log('signAlgoDemo')
  const keys = await RSA.generate()
  const signature = await RSA.signWithAlgorithm(secret, keys.private, RSA.SHA256withRSA)
  console.log('signature', signature);
  const valid = await RSA.verifyWithAlgorithm(signature, secret, keys.public, RSA.SHA256withRSA)
  console.log('verified', valid);
}