jwe-lite
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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

/jwe-lite/

    Package Sidebar

    Install

    npm i jwe-lite

    Weekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    3.07 kB

    Total Files

    3

    Last publish

    Collaborators

    • kevlened