datatables.net-key-validator-shim
v1.0.0
Published
A minimal implementation of crypto.subtle with ECDSA / P-256 to validate keys.
Readme
An extremely minimal key validator
Web-browsers provide crypto.subtle which can be used to validate public / private key digital signature. This API is used by DataTables Plus to verify license keys. However, crypto.subtle is not available on connections which are not secured by SSL (i.e. if you are using http://, which is common in local development and testing). In such a case, the license key cannot be validated.
This library provides that ability, acting as a shim for the specific validation that DataTables Plus uses (ECDSA / P-256). That is all it provides! It is not a full shim for the web crypto API.
If you need the complete web crypto API on an insecure connection, use webcrypto-liner or similar, which can be used in place of this library. It is a larger, more complete package, while this one focuses on a single task only.
Installation
This library can be installed from npm using:
npm install --save datatables.net-key-validator-shimOr from the DataTables CDN:
https://cdn.datatables.net/key-validator-shim/1.0.0/index.min.jsYou can also use the DataTables download builder and select the "Key Verification Shim" package in the "External libraries" section.
Usage
If you are a developer using DataTables, or some other library that makes use of the functionality provided by this package, you don't need to do anything other than include the library.
NPM
To include when using a package manager / bundler:
import 'datatables.net-key-validator-shim';The package will automatically attach itself to the window global when run on the client-side.
CDN / download
Include the library directly be including the script (or use the DataTables download builder to build a package for you):
<script src="https://cdn.datatables.net/key-validator-shim/1.0.0/index.min.js"></script>Make sure you include this before you load DataTables core. Again, it will automatically attach itself to the window global, allowing the key verification used by DataTables to complete.
Package managers
If you are implementing key verification, see the MDN documentation for crypto.subtle.
