Created
April 17, 2019 16:05
-
-
Save billchurch/4fc440fdd036d4937b1feb03236e54d2 to your computer and use it in GitHub Desktop.
PoC to verify cert with node-forge from cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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