google-p12-pem

NPM Version Build Status Dependency Status devDependency Status Known Vulnerabilities Greenkeeper badge

Convert Google .p12 keys to .pem keys.

Installation

npm install google-p12-pem

Usage

async/await style

const {getPem} = require('google-p12-pem');
async function foo() {
  const pem = await getPem('/path/to/key.p12');
  console.log(pem); // '-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAK...'
}

promise style

const {getPem} = require('google-p12-pem');
getPem('/path/to/key.p12')
  .then(pem => {
    console.log(pem); // '-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAK...'
  })
  .catch(err => {
    console.error(err); // :(
  });

callback style

const {getPem} = require('google-p12-pem');
getPem('/path/to/key.p12', function(err, pem) {
  console.log(pem); // '-----BEGIN RSA PRIVATE KEY-----\nMIICXQIBAAK...'
});

CLI style

gp12-pem myfile.p12 > output.pem

License

MIT