Skip to content

dannycoates/pem-jwk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pem-jwk

convert between PEM and JWK key serialization formats

Usage

As a commandline tool:

$ npm install -g pem-jwk
$ openssl genrsa 2048 | pem-jwk > private.jwk
$ pem-jwk private.jwk > private.pem

Example

var assert = require('assert')
var fs = require('fs')
var pem2jwk = require('pem-jwk').pem2jwk
var jwk2pem = require('pem-jwk').jwk2pem

var str = fs.readFileSync('./test/priv.pem', 'ascii')
var jwk = pem2jwk(str)
var pem = jwk2pem(jwk)
assert.equal(pem, str)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published