Common encryption/decryption for react-native
- RSA
- AES
- Hmac
- Pbkdf2
- Sha
npm install @trackforce/react-native-crypto
or
yarn add @trackforce/react-native-crypto
react-native link
- See Linking Libraries OR
- Drag RCTCrypto.xcodeproj to your project on Xcode.
- Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTCrypto.a from the Products folder inside the RCTCrypto.xcodeproj.
...
include ':@trackforce/react-native-crypto'
project(':@trackforce/react-native-crypto').projectDir = new File(rootProject.projectDir, '../node_modules/@trackforce/react-native-crypto/android')
- In
android/app/build.gradle
...
dependencies {
...
compile project(':@trackforce/react-native-crypto')
}
- register module (in MainApplication.java)
......
import com.trackforce.aes.RCTCryptoPackage;
......
@Override
protected List<ReactPackage> getPackages() {
......
new RCTCryptoPackage(),
......
}
yarn install
cd demo
yarn install
react-native run-ios
Note: React native doesn't support Symlinks. See Stackoverflow.
See example App.tsx for usage
See Typescript typings