jwks2pem

command module
v0.0.0-...-edc26e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2022 License: MIT Imports: 7 Imported by: 0

README

jwks2pem

read jwks from stdin and write PEM to stdout

What is it for?

OpenID Connect identity providers have a JWT keyset endpoint.

The most widely used JWT validation library in golang wants a PEM public key.

Converting them is a PITA, and I've wasted time figuring out the magic openssl incantations for the last time now.

How to use it?

If you clone this repository outside your GOPATH, go build -o jwks2pem main.go should produce an simple executable that takes care of the conversion for you.

It reads a jwks from standard input, and writes the PEM format of all keys in the set to stdout, so you can do

curl -s <jwks-url> | ./jwks2pem

Note: if your public keys in the key set aren't RSA keys, you will have to make a rather obvious change to the code. Just replace the &rsa.PublicKey{} with the appropriate type.

Acknowledgements

Many thanks to

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL