Skip to content
Web Cryptography API for React Native
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src set crypto as fake in webview-crypto instead of here Aug 28, 2016
.gitignore Rename npm module Jul 14, 2016
.travis.yml Don't test on android 5.0 Aug 3, 2016
README.md Update README.md Jul 14, 2018
package.json 0.0.16 Aug 30, 2016
tsconfig.json
tslint.js initial Jun 17, 2016
typings.json Closer to working... Jul 15, 2016

README.md

react-native-webview-crypto

npm Dependency Status

This brings window.Crypto to your React Native application. It does this by communicating with a hidden WebView, which performs the actual computation.

Refer to the webview-crypto repo for most of the code and some cavaets.

Install

  1. Get started with React Native
  2. Install React Native WebView Javascript Bridge and verify that it is working for your platform.
  3. npm install --save react-native-webview-crypto

Quickstart

Rendering the PolyfillCrypto will start up a WebView to transparently proxy all the crypto calls to.

import React, { Component } from 'react';
import { View } from 'react-native';

import App from './app';

import PolyfillCrypto from 'react-native-webview-crypto';

class TopLevelComponent extends Component {
  render() {
    // set`debug` prop to `true` to have it print to the console as it runs
    return (
      <View>
        <PolyfillCrypto />
        <App />
      </View>
    );
  }
}

AppRegistry.registerComponent('WhateverName', () => TopLevelComponent);

Now, in any of your code, you can access window.crypto, just like you would in a browser.

There is also an example repo which runs some example crypto using this library.

This project was funded by Burke Software and Consulting LLC for passit.

You can’t perform that action at this time.