Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

jwe-lite

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwe-lite

isomorphic library to decode, sign, and verify JSON Web Signatures

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

jwe-lite

Install

npm install jwe-lite

Usage

const jwe = require('jwe-lite')

const decoded = jwe.decode('somejwe');
const {
  header,            // jose header
  key,               // encrypted key
  iv,                // initialization vector
  encryptedContent,  // UintArray of the encrypted content
  tag                // UintArray of the authentication tag
} = decoded;

jwe.encrypt(payload, jwk)
.then(jweToken => console.log(jweToken))

jwe.decrypt(jweToken, jwk)
.then(payload => console.log(payload))

Can it be smaller?

If you use ES6 imports with a bundler that supports tree-shaking, yes!

import { encrypt } from 'jwe-lite'

License

MIT

FAQs

Package last updated on 09 Sep 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