Skip to content

Instantly share code, notes, and snippets.

@ozten
Created July 16, 2012 20:20
Show Gist options
  • Select an option

  • Save ozten/3124781 to your computer and use it in GitHub Desktop.

Select an option

Save ozten/3124781 to your computer and use it in GitHub Desktop.
Get public key or other fields from a cert
/*
cd into directory with root.cert
node extract_public_key.js
*/
var fs = require('fs');
cert = fs.readFileSync('root.cert').toString('utf8');
var pkEnc = cert.split('.')[1]
console.log(new Buffer(pkEnc, 'base64').toString('utf8'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment