JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24559270
  • Score
    100M100P100Q254314F
  • License Apache-2.0

Provides functions for detecting if the host environment supports the WebCrypto API

Package Exports

  • @aws-crypto/supports-web-crypto
  • @aws-crypto/supports-web-crypto/build/main/index.js
  • @aws-crypto/supports-web-crypto/build/module/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@aws-crypto/supports-web-crypto) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@aws-crypto/supports-web-crypto

Functions to check web crypto support for browsers.

Usage

import {supportsWebCrypto} from '@aws-crypto/supports-web-crypto';

if (supportsWebCrypto(window)) {
  // window.crypto.subtle.encrypt will exist
}

supportsWebCrypto

Used to make sure window.crypto.subtle exists and implements crypto functions as well as a cryptographic secure random source exists.

supportsSecureRandom

Used to make sure that a cryptographic secure random source exists. Does not check for window.crypto.subtle.

supportsSubtleCrypto

supportsZeroByteGCM

Test

npm test