GithubHelp home page GithubHelp logo

pat-glich / react-native-secure-key-store Goto Github PK

View Code? Open in Web Editor NEW

This project forked from getdreams/react-native-secure-key-store

0.0 0.0 0.0 193 KB

React Native Library for securely storing keys to iOS KeyChain and Android KeyStore.

License: ISC License

Ruby 2.02% Java 38.23% JavaScript 10.30% Python 6.42% Objective-C 43.04%

react-native-secure-key-store's Introduction

react-native-secure-key-store

React Native Library for securely storing keys to iOS and Android devices in KeyChain and KeyStore respectively

Getting started

$ npm install react-native-secure-key-store --save

or

$ yarn add react-native-secure-key-store --save

Mostly automatic installation

$ react-native link react-native-secure-key-store

Manual installation

iOS

With cocoa pods
  1. Edit Podfile add pod 'RNSecureKeyStore', :git => 'https://github.com/psomialbert/react-native-secure-key-store.git', :tag => 'master' or ex. pod "RNSecureKeyStore", :path => "../node_modules/react-native-secure-key-store" (depending on where your node_modules directory is)
  2. Run pod install
Without cocoa pods
  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-secure-key-store and add RNSecureKeyStore.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNSecureKeyStore.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNSecureKeyStorePackage; to the imports at the top of the file
  • Add new RNSecureKeyStorePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-secure-key-store'
    project(':react-native-secure-key-store').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-secure-key-store/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
    compile project(':react-native-secure-key-store')
    

Usage

import RNSecureKeyStore from 'react-native-secure-key-store';

// For storing key
RNSecureKeyStore.set("key1", "value1")
	.then((res) => {
		console.log(res);
	}, (err) => {
		console.log(err);
	});

// For retrieving key
RNSecureKeyStore.get("key1")
	.then((res) => {
		console.log(res);
	}, (err) => {
		console.log(err);
	});

// For removing key
RNSecureKeyStore.remove("key1")
	.then((res) => {
		console.log(res);
	}, (err) => {
		console.log(err);
	});		
  • For demo app, checkout example directory.

License

ISC License (ISC) Copyright (c) 2016 pradeep singh

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

react-native-secure-key-store's People

Contributors

pradeep1991singh avatar ninaniiranen avatar valentinwallet avatar lenkavon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.