rsa util for iOS and Android
npm i react-native-rsa-util
rnpm link react-native-rsa-util
import ReactNativeRSAUtil from 'react-native-rsa-util';
ReactNativeRSAUtil.encryptStringWithPublicKey(content, RSA_PUBLIC_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
ReactNativeRSAUtil.decryptStringWithPublicKey(content, RSA_PUBLIC_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
ReactNativeRSAUtil.encryptStringWithPrivateKey(content, RSA_PRIVATE_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
ReactNativeRSAUtil.decryptStringWithPrivateKey(content, RSA_PRIVATE_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});