1.1.2 • Published 3 years ago

react-native-pinning-sha256 v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-pinning-sha256

A react-native library for pinning SSL using SHA-256 public key.

Getting started

$ yarn add react-native-pinning-ssl

Get SHA-256 key

Usage

import { isSSLValid } from "react-native-pinning-sha256";

async function runSSLPinning() {
  try {
    const result = await isSSLValid({
      url: "https://github.com/",
      hashes: ["CA 06 F5 6B 25 8B 7A 0D 4F 2B 05 47 09 39 47 86 51 15 19 84"],
      domainNames: ["github.com"],
    });

    return result;
  } catch (e) {
    console.log(e);
  }
}

runSSLPinning();

References

NSURLAuthenticationChallenge+Fingerprint credited to https://stackoverflow.com/a/26963381