Gazebo_simulation-Frontend/node_modules/jwk-lite
Riddhi Dave c586e2ed33 session update with django backend 2021-02-25 10:57:52 -05:00
..
dist React files 2020-12-21 10:29:31 -05:00
typescript React files 2020-12-21 10:29:31 -05:00
LICENSE React files 2020-12-21 10:29:31 -05:00
README.md React files 2020-12-21 10:29:31 -05:00
package.json session update with django backend 2021-02-25 10:57:52 -05:00

README.md

jwk-lite

Install

npm install jwk-lite

Usage

const jwk = require('jwk-lite')

jwk.generateKey('HS256')
.then(keys => {
  console.log(keys.sharedKey)
})

jwk.generateKey('PS256')
.then(keys => {
  console.log(keys.publicKey)
  console.log(keys.privateKey)
})

jwk.generateKey('RS256')
.then(keys => {
  console.log(keys.publicKey)
  console.log(keys.privateKey)
})

jwk.generateKey('ES256')
.then(keys => {
  console.log(keys.publicKey)
  console.log(keys.privateKey)
})

jwk.exportKey(key)
.then(jsonJwk => console.log(jsonJwk))

jwk.import(jsonJwk)
.then(key => console.log(key))

Can it be smaller?

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

import { generateKey } from 'jwk-lite'

License

MIT