publickeyJwk - Json Web Key in go lang

Does anyone worked on implementing the json web key public key encoding in golang.

What is most appropriate go lang library to decode the JWK using ecds algortithm

I’ve played around with jwt-go some time ago. Using a public/private key pair, the code looks like in the gist below.

Note that I’ve embedded the jwt.StandardClaims in my own struct sbcsClaims. This of course is optional.

I have figured out and using “github.com/lestrrat-go/jwx/jwk

func getPublicKeyJwk(jsonBuf []byte) (interface{}, error) {
pubKeyJwk, err := jwk.Parse(jsonBuf)
if err != nil {
return nil, err
}
key := pubKeyJwk.Keys[0]
pubKey, err := key.Materialize()
if err != nil {
return nil, err
}
return pubKey, nil
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.