https://github.com/rnkit/react-native-rsa-util
rsa util for iOS and Android
https://github.com/rnkit/react-native-rsa-util
Last synced: 3 months ago
JSON representation
rsa util for iOS and Android
- Host: GitHub
- URL: https://github.com/rnkit/react-native-rsa-util
- Owner: rnkit
- License: apache-2.0
- Created: 2016-05-19T09:14:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-14T06:00:19.000Z (over 9 years ago)
- Last Synced: 2025-07-24T02:10:04.774Z (11 months ago)
- Language: Objective-C
- Size: 151 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-rsa-util
rsa util for iOS and Android
## How To Use This
### 1. npm install this module
```
npm i react-native-rsa-util
```
### 2. use rnpm to link project file
```
rnpm link react-native-rsa-util
```
### 3. import react-native-rsa-util
```
import ReactNativeRSAUtil from 'react-native-rsa-util';
```
### 4. use it !!!
#### encryptStringWithPublicKey
```
ReactNativeRSAUtil.encryptStringWithPublicKey(content, RSA_PUBLIC_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
```
#### decryptStringWithPublicKey
```
ReactNativeRSAUtil.decryptStringWithPublicKey(content, RSA_PUBLIC_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
```
#### encryptStringWithPrivateKey
```
ReactNativeRSAUtil.encryptStringWithPrivateKey(content, RSA_PRIVATE_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
```
#### decryptStringWithPrivateKey
```
ReactNativeRSAUtil.decryptStringWithPrivateKey(content, RSA_PRIVATE_KEY)
.then((error, data) => {
if ( !error ) {
console.log(data);
}
});
```