Package Exports
- json-web-key
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json-web-key) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
JSON Web Key
Install via npm
$ npm install --save json-web-keyUsage
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 ) // -> StringAPI Reference
Classes
- JSONWebKey
JSONWebKey
Kind: global class
- JSONWebKey
- new JSONWebKey()
- .PEM :
Object - .getPEMBuffer(pem) ⇒
Buffer - .fromPEM(pem) ⇒
JSONWebKey - .fromJSON(json) ⇒
JSONWebKey
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
| Param | Type |
|---|---|
| pem | String | Buffer |
JSONWebKey.fromPEM(pem) ⇒ JSONWebKey
Create a JSON Web Key from PEM data
Kind: static method of JSONWebKey
| Param | Type |
|---|---|
| pem | String | Buffer |
JSONWebKey.fromJSON(json) ⇒ JSONWebKey
Create a JSON Web Key from JSON data
Kind: static method of JSONWebKey
| Param | Type |
|---|---|
| json | Object | String |