5.1.7 • Published 12 months ago

@smartface/security v5.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Twitter: @Smartface_io License: MIT

Security

Intro

This module provides security tools (e.g. GoogleSafetyNet) for Smartface applications.

GooglePlayServices

Helper class for Google Play Services. Android relies on a security Provider to provide secure network communications. However, from time to time, vulnerabilities are found in the default security provider. To protect against these vulnerabilities, Google Play services provides a way to automatically update a device's security provider to protect against known exploits. By calling Google Play services methods, your app can ensure that it's running on a device that has the latest updates to protect against known exploits.

Example Usage

import { GooglePlayServices } from "@smartface/security";
if (System.OS === "Android") {
  GooglePlayServices.upgradeSecurityProvider()
    .then(() => {
      console.info(
        "Provider is up-to-date, app can make secure network calls."
      );
    })
    .catch((errorCode) => {
      console.error("Error code: ", errorCode);
    });
}

GoogleSafetyNet

Helper class for Google's SafetyNet. SafetyNet provides a set of services and APIs that help protect your app against security threats, including device tampering, bad URLs, potentially harmful apps, and fake users.

Example Usage

import { GoogleSafetyNet } from "@smartface/security";
if (System.OS === System.OSType.ANDROID) {
  const googleSafetyNet = new GoogleSafetyNet({
    apiKey: "**********",
  });
  if (googleSafetyNet.isPlayServicesAvailable()) {
    let nonce = googleSafetyNet.generateNonce();
    // Nonce should be at least 16 bytes length
    googleSafetyNet
      .sendAttestationRequest(nonce)
      .then((jws) => {
        console.info(`JWS ${jws}`);
      })
      .catch((e) => {
        console.error(e);
      });
  } else {
    console.info(
      "Google Play services are not available. You cannot proceed further"
    );
  }
}
5.1.5

1 year ago

5.1.4

1 year ago

5.1.7

12 months ago

5.1.6

1 year ago

5.1.3

1 year ago

5.1.2

1 year ago

5.1.1

1 year ago

5.1.0

1 year ago

5.0.10

1 year ago

5.1.0-beta.0

1 year ago

5.0.9

1 year ago

5.0.8

1 year ago

5.0.5

2 years ago

5.0.8-alpha.2

1 year ago

5.0.7

2 years ago

5.0.5-alpha.4

2 years ago

5.0.5-alpha.3

2 years ago

5.0.5-alpha.5

2 years ago

5.0.5-alpha.2

2 years ago

5.0.5-alpha.1

2 years ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.2-alpha.0

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

5.0.0-beta.1

2 years ago

5.0.3-beta.2

2 years ago

5.0.0-beta.0

2 years ago

5.0.0-alpha.0

2 years ago

1.0.0

2 years ago