Skip to content

Instantly share code, notes, and snippets.

@monmohan
monmohan / request_hangs.go
Created July 11, 2020 16:59
Gist for Blog
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"net/http/httputil"
"time"
@monmohan
monmohan / http_request_with_context.go
Last active July 11, 2020 16:57
Sample code to accompany the blog
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/http/httputil"
"time"
@monmohan
monmohan / asymmetric.go
Last active January 18, 2023 09:02
JWK - Certificate from X5c and validation
package jws
import (
"bytes"
"crypto"
"crypto/rsa"
_ "crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/binary"
@monmohan
monmohan / x5c.der
Created November 11, 2019 14:06
Certificate created from x5c string
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
6a:4a:0f:86:8d:0c:26:be:7a
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=dev-ejtl988w.auth0.com
Validity
Not Before: Oct 29 22:07:22 2019 GMT
Not After : Jul 7 22:07:22 2033 GMT
@monmohan
monmohan / asymmetric.go
Created November 7, 2019 10:06
Sample JWS Validation with RSA Key
package jws
import (
"bytes"
"crypto"
"crypto/rsa"
_ "crypto/sha256"
"encoding/base64"
"encoding/binary"
"math/big"