# rsa-unpack unpack rsa fields from PEM strings [![build status](https://secure.travis-ci.org/substack/rsa-unpack.png)](http://travis-ci.org/substack/rsa-unpack) # example ``` $ rsa-json > keys.json ``` ``` js var fs = require('fs'); var keys = require('./keys.json'); var unpack = require('rsa-unpack'); var rsa = unpack(keys.private); console.dir(rsa); ``` *** ``` $ node example/unpack.js { modulus: , bits: 1073, publicExponent: 65537, privateExponent: , prime1: , prime2: , exponent1: , exponent2: , coefficient: } ``` # methods ``` js var unpack = require('rsa-unpack') ``` ## unpack(pemKeyString) Unpack the PEM-formatted string `pemKeyString` into the RSA field values. The key can be a public or private key. If the key is invalid, returns undefined. # command-line usage ``` usage: rsa-unpack {FILE|-} OPTIONS OPTIONS: --format format to expect FILE to be in. default: pem or json if FILE ends in .json --encoding, -e encoding to use. default: hex ``` # install With [npm](https://npmjs.org) do: ``` npm install rsa-unpack ``` # license MIT