New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-web-key

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-web-key

JSON Web Key

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

JSON Web Key

npm npm license npm downloads build status

Install via npm

$ npm install --save json-web-key

Usage

var JSONWebKey = require( 'json-web-key' )
// Constructing a JWK from PEM data
var webKey = JSONWebKey.fromPEM( '-----BEGIN PUBLIC KEY-----\nMIIBIjANB...' )
// Constructing a JWK from JSON data
var webKey = JSONWebKey.fromJSON({
  "kty": "RSA",
  "n": "oL9U7lsMfBGZiFO...",
  "e": "AQAB"
})
// Formatting as JSON
webKey.toJSON() // -> Object
JSON.stringify( webKey ) // -> String

API Reference

Classes

JSONWebKey

JSONWebKey

Kind: global class

new JSONWebKey()

JSONWebKey

JSONWebKey.PEM : Object

Key structures

Kind: static property of JSONWebKey

JSONWebKey.getPEMBuffer(pem) ⇒ Buffer

Parse PEM content into a Buffer

Kind: static method of JSONWebKey

ParamType
pemString | Buffer

JSONWebKey.fromPEM(pem) ⇒ JSONWebKey

Create a JSON Web Key from PEM data

Kind: static method of JSONWebKey

ParamType
pemString | Buffer

JSONWebKey.fromJSON(json) ⇒ JSONWebKey

Create a JSON Web Key from JSON data

Kind: static method of JSONWebKey

ParamType
jsonObject | String

Keywords

jwk

FAQs

Package last updated on 07 Nov 2018

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