Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 20, 2024 via pnpm

jwa 2.0.0

JWA implementation (supports all JWS algorithms)
Package summary
Share
0
issues
3
licenses
2
MIT
1
BSD-3-Clause
1
Apache-2.0
Package created
10 Feb 2013
Version published
15 Dec 2019
Maintainers
7
Total deps
4
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
jwa@2.0.0
safe-buffer@5.2.1

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
buffer-equal-constant-time@1.0.1

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
ecdsa-sig-formatter@1.0.11
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of jwa 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
buffer-equal-constant-time1.0.13.05 kBBSD-3-Clause
prod
ecdsa-sig-formatter1.0.116.94 kBApache-2.0
prod
safe-buffer5.2.19.74 kBMIT
prod

Visualizations

Frequently Asked Questions

What does jwa do?

JWA, short for JSON Web Algorithms, is an npm package that provides an implementation for all JSON Web Signature (JWS) algorithms. Its purpose is to support cryptographic processes tied to JSON Web Signatures, enabling the use of all the required, recommended, and optional cryptographic algorithms specified for JWS. These include HMAC using SHA-256, SHA-384, and SHA-512 hash algorithms; RSASSA using SHA-256, SHA-384, SHA-512 hash algorithms; RSASSA-PSS using SHA-256, SHA-384, SHA-512 hash algorithms; ECDSA using SHA-256, SHA-384, SHA-512 hash algorithms with their respective curves; and the case where no digital signature or MAC value is needed.

How do you use jwa?

Using JWA in your JavaScript project is quite straightforward. Import the module using require('jwa'). From there, you can invoke the imported function with the appropriate algorithm as a string argument.

Here are two examples:

For HMAC:

const jwa = require('jwa');

const hmac = jwa('HS256');
const input = 'super important stuff';
const secret = 'shhhhhh';

const signature = hmac.sign(input, secret);
hmac.verify(input, signature, secret) // returns true
hmac.verify(input, signature, 'trickery!') // returns false

For keys:

const fs = require('fs');
const jwa = require('jwa');
const privateKey = fs.readFileSync(__dirname + '/ecdsa-p521-private.pem');
const publicKey = fs.readFileSync(__dirname + '/ecdsa-p521-public.pem');

const ecdsa = jwa('ES512');
const input = 'very important stuff';

const signature = ecdsa.sign(input, privateKey);
ecdsa.verify(input, signature, publicKey) // returns true

Where are the jwa docs?

The primary source of documentation for the JWA npm package can be found in its README file on the GitHub project page, node-jwa. This documentation provides an overview of the tool as well as how to use it, including various use-case examples. As an open-source project, discussions and additional insights related to the package can likely also be found in the issues and pull requests of the GitHub repository.