Skip to content

Latest commit

 

History

History
81 lines (67 loc) · 3.08 KB

README.md

File metadata and controls

81 lines (67 loc) · 3.08 KB

React Native Secure Keystore

This React Native module lets you store cryptographic keys in a container to make it more difficult to extract from the device.

Current functions:  
 - Generate Key pair and save them.
 - Get Public Key string and fingerprint. 
 - Sign data with Private key.

Features!

  • Use Android and IOS native key store system for saving keypair secure.
  • Android Minimum SDK Level = 18

Installation

first get source code.

$ git clone https://github.com/pesehr/secureKeyStore.git

now you can install module with following instruction.

  • Android

    • goto Android folder and copy all java files to your android sorce code folder of your react native project. now ajust the codes with your project.
    • copy following code line to your MainApplication.java:
      new SecureKeyStoreModulePack()
      your code have must be like this:
      public class MainApplication extends Application implements ReactApplication {
          private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
          @Override
          public boolean getUseDeveloperSupport() {
                return BuildConfig.DEBUG;
           }
          @Override
           protected List<ReactPackage> getPackages() {
              return Arrays.<ReactPackage>asList(
              new MainReactPackage(),
              new SecureKeyStoreModulePack()
                  );
              }
          };
      }
  • IOS

    install this module on ios devices is more difficult then android. please do all instructions carefully
  • NodeJS

    • you can invoke native methodes by NativeModule object. for example you could invoce generateKeys method like this:
      import { NativeModules } from 'react-native';
      NativeModules.SecureKeyStore.generateKeys();

Todos

  • Correct English writing wrongs!!!
  • Add encryption with publickey and decryption with privatekey.
  • Installation using npm.

Contributing

Please create issues and send pull requests!

License

MIT

Free Software, Hell Yeah!