Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jwa

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwa

JWA implementation (supports all JWS algorithms)

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27M
increased by3.11%
Maintainers
3
Weekly downloads
 
Created

What is jwa?

The jwa npm package is a JavaScript implementation of JSON Web Algorithms (JWA) as specified in RFC 7518. It provides functionality to perform cryptographic operations such as signing and verifying signatures using various algorithms.

What are jwa's main functionalities?

Signing

This feature allows you to create a signature for a given payload using a specified algorithm and secret. The 'HS256' algorithm is used in this example to sign the 'Hello, world!' payload.

"use strict";\nconst jwa = require('jwa');\nconst algorithm = 'HS256';\nconst hmac = jwa(algorithm);\nconst secret = 'mysecret';\nconst payload = 'Hello, world!';\nconst signature = hmac.sign(payload, secret);\nconsole.log('Signature:', signature);

Verifying Signatures

This feature allows you to verify a signature for a given payload using the same algorithm and secret that were used to sign the payload. It returns a boolean indicating whether the signature is valid.

"use strict";\nconst jwa = require('jwa');\nconst algorithm = 'HS256';\nconst hmac = jwa(algorithm);\nconst secret = 'mysecret';\nconst payload = 'Hello, world!';\nconst signature = 'signatureFromSigning';\nconst isValid = hmac.verify(payload, signature, secret);\nconsole.log('Is signature valid?', isValid);

Other packages similar to jwa

Keywords

FAQs

Package last updated on 15 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc