Coder Social home page Coder Social logo

react-native-key-pair's Introduction

react-native-key-pair

A native implementation of Public/Private RSA key genaration.

Usage

import KeyPair from 'react-native-key-pair'
KeyPair.generate((keys)=>{
   console.log(keys.private) // the private key
   console.log(keys.public) // the public key
})

Getting started

$ npm install react-native-key-pair --save

Mostly automatic installation

$ react-native link react-native-key-pair

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-key-pair and add RNKeyPair.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNKeyPair.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.RNKeyPairPackage; to the imports at the top of the file
  • Add new RNKeyPairPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-key-pair'
    project(':react-native-key-pair').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-key-pair/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-key-pair')
    

Windows

Read it! :D

  1. In Visual Studio add the RNKeyPair.sln in node_modules/react-native-key-pair/windows/RNKeyPair.sln folder to their solution, reference from their app.
  2. Open up your MainPage.cs app
  • Add using Cl.Json.RNKeyPair; to the usings at the top of the file
  • Add new RNKeyPairPackage() to the List<IReactPackage> returned by the Packages method

Usage

import RNKeyPair from 'react-native-key-pair';

// TODO: What do with the module?
RNKeyPair;

react-native-key-pair's People

Contributors

nihgwu avatar pmusaraj avatar samsaffron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-key-pair's Issues

npm install react-native-key-pair gives an error that react-native-key-pair is not in the npm registry

npm ERR! Linux 4.2.0-27-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "react-native-key-pair"
npm ERR! node v7.7.1
npm ERR! npm v4.1.2
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/react-native-key-pair
npm ERR! 404
npm ERR! 404 'react-native-key-pair' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /home/../../npm-debug.log

cant run on RN60

I get this error on RN 60 on IOS

TypeError: Cannot read property 'generate' of undefined

This error is located at:
    in Splash (created by ConnectFunction)
    in ConnectFunction (at SceneView.js:9)
    in SceneView (at StackViewLayout.tsx:899)
    in RCTView (at View.js:35)
    in View (at createAnimatedComponent.js:151)
    in AnimatedComponent (at StackViewCard.tsx:93)
    in RCTView (at View.js:35)
    in View (at createAnimatedComponent.js:151)
    in AnimatedComponent (at screens.native.js:71)
    in Screen (at StackViewCard.tsx:80)
    in Card (at createPointerEventsContainer.tsx:95)
    in Container (at StackViewLayout.tsx:971)
    in RCTView (at View.js:35)
    in View (at screens.native.js:101)
    in ScreenContainer (at StackViewLayout.tsx:383)
    in RCTView (at View.js:35)
    in View (at createAnimatedComponent.js:151)
    in AnimatedComponent (at StackViewLayout.tsx:379)
    in PanGestureHandler (at StackViewLayout.tsx:372)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.tsx:103)
    in RCTView (at View.js:35)
    in View (at Transitioner.tsx:267)
    in Transitioner (at StackView.tsx:40)
    in StackView (at createNavigator.js:61)
    in Navigator (at createKeyboardAwareNavigator.js:12)
    in KeyboardAwareNavigator (at createAppContainer.js:429)
    in NavigationContainer (at routing.js:174)
    in App (at app.js:18)
    in Provider (at app.js:17)
    in App (at renderApplication.js:40)
    in RCTView (at View.js:35)
    in View (at AppContainer.js:98)
    in RCTView (at View.js:35)
    in View (at react-native-root-siblings/index.js:34)
    in RootSiblingsWrapper (at AppContainer.js:112)
    in RCTView (at View.js:35)
    in View (at AppContainer.js:115)
    in AppContainer (at renderApplication.js:39)

Splash.componentDidMount
    index.js:39:10
Splash.proxiedComponentDidMount
    createPrototypeProxy.js:61:39
unstable_runWithPriority
    scheduler.development.js:471:11

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.