@dalisoft/jwe

0.0.3 • Public • Published

JWE

JWE Helper for Auth building from scratch

Features

  • Fast
  • Zero-config
  • Well tested
  • Good security

Import

// ES6
import { sign, verify, decode } from "@dalisoft/jwe";

// or

// CommonJS
const JWE = require("@dalisoft/jwe");

Example

const { sign, verify, decode } = JWE;

const token = await sign(payload: object, secret: string | any, options: object): string;

For more info see tests.

Methods

#sign(payload: object, secret: string | any, options: object): string

Returns value of signed (+ maybe secured) token

#verify(token: string, secret: string | any, options: object): object | null

Returns value of signed (+ maybe secured) token

#decode(token: string, secret: string | any, options: object): object | null

Decodes value of signed (+ maybe secured) token without needing verifying signature

License

MIT

Package Sidebar

Install

npm i @dalisoft/jwe

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

6.88 kB

Total Files

9

Last publish

Collaborators

  • dalisoft