pem-jwk

2019-08-15 admin

pem-jwk是什么

什么是pem-jwk,convert between PEM and JWK formats

pem-jwk使用教程帮助文档

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)

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-72588.html

文章标题:pem-jwk

回到顶部