Skip to content

Instantly share code, notes, and snippets.


Robin Cher robincher

View GitHub Profile
robincher /
Created Jan 31, 2020
Insert database records from text file
echo "Please enter database Password:"
if [ -z "DB_PASSWD" ]; then
echo "Please DB Password"
exit 1
robincher /
Created Aug 29, 2019
Map ca certificate with consumer object
# Create manual mappings between certificate and Consumer objec
curl -X POST -H 'Kong-Admin-Token:xxxxxx' http://localhost:8001/Scratch/consumers/helios/mtls-auth -d ''
# Test route with MTLS and Basic Auth Plugin enabled
curl -kv -H 'Authorization: Bearer Basic xxxxxxx' --key helios.key --cert helios.crt https://localhost:8443/mockbin/request
robincher /
Created Aug 29, 2019
Self-Signed CA and Client Certificate
#Generate Self-signed CA
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout ca.key -out ca.crt
#Make a directory
mkdir client
#Generate Corresponding client certificate
openssl genrsa -out client/helios.key 2048

Keybase proof

I hereby claim:

  • I am robincher on github.
  • I am robincher ( on keybase.
  • I have a public key ASAnWqIXbW8XGBZCwtZJx4tLmEmBLQpUdc5-4pMChJ1gbAo

To claim this, I am signing this object:

robincher / index.js
Created Sep 8, 2018
Parsing X509 Certificate using pkijs
View index.js
const atob = require('atob');
const asn1js = require('asn1js');
const fs = require('fs');
const pkijs = require('pkijs');
const pvutils = require('pvutils')
const Certificate = pkijs.Certificate
let certificateBuffer = new ArrayBuffer(0);
You can’t perform that action at this time.