Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const keychainDemo = async () => {
const keys = await RSAKeychain.generate(keyTag)
console.log(keys.public);
console.log(secret);
const encodedMessage = await RSAKeychain.encrypt(secret, keyTag)
console.log(encodedMessage);
const message = await RSAKeychain.decrypt(encodedMessage, keyTag)
console.log(message);
const signature = await RSAKeychain.sign(secret, keyTag)
console.log('signature', signature);
const valid = await RSAKeychain.verify(signature, secret, keyTag)
console.log('verified', valid);
const publicKey = await RSAKeychain.getPublicKey(keyTag)
console.log('getPublicKey', publicKey)
const success = await RSAKeychain.deletePrivateKey(keyTag)
console.log('delete success', success)
}