Skip to content

Instantly share code, notes, and snippets.

@billchurch
Created April 17, 2019 16:05
Show Gist options
  • Save billchurch/4fc440fdd036d4937b1feb03236e54d2 to your computer and use it in GitHub Desktop.
Save billchurch/4fc440fdd036d4937b1feb03236e54d2 to your computer and use it in GitHub Desktop.
PoC to verify cert with node-forge from cli
const fs = require('fs'), pki = require('node-forge').pki
var ca = pki.certificateFromPem(fs.readFileSync('ca.pem', 'ascii'))
var client = pki.certificateFromPem(fs.readFileSync('client.pem', 'ascii'))
try {
if (!ca.verify(client)) throw 'verify failed'
} catch (err) {
console.log(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment