package
JSON Web Key
npm install json-web-keyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 6 packages.
203.9 kB
Includes dependencies.
$ npm install --save json-web-keyvar 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 ) // -> StringKind: global class
ObjectBufferJSONWebKeyJSONWebKeyJSONWebKey
ObjectKey structures
Kind: static property of JSONWebKey
BufferParse PEM content into a Buffer
Kind: static method of JSONWebKey
| Param | Type |
|---|---|
| pem | String | Buffer |
JSONWebKeyCreate a JSON Web Key from PEM data
Kind: static method of JSONWebKey
| Param | Type |
|---|---|
| pem | String | Buffer |
JSONWebKeyCreate a JSON Web Key from JSON data
Kind: static method of JSONWebKey
| Param | Type |
|---|---|
| json | Object | String |