{"id":24171264,"url":"https://github.com/micahparks/jwkset","last_synced_at":"2025-04-09T06:13:09.265Z","repository":{"id":61623587,"uuid":"536354840","full_name":"MicahParks/jwkset","owner":"MicahParks","description":"A JWK and JWK Set implementation. An auto-caching JWK Set HTTP client is provided. Generate, validate, and inspect JWKs. Self-host this project's website: https://jwkset.com","archived":false,"fork":false,"pushed_at":"2025-04-05T20:10:23.000Z","size":785,"stargazers_count":48,"open_issues_count":0,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T06:13:01.119Z","etag":null,"topics":["go","golang","jwk","jwks","jwks-endpoint","jwks-rsa","jwkset","rfc7517"],"latest_commit_sha":null,"homepage":"https://jwkset.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicahParks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"MicahParks"}},"created_at":"2022-09-14T00:26:09.000Z","updated_at":"2025-04-05T20:09:59.000Z","dependencies_parsed_at":"2024-01-18T01:18:20.938Z","dependency_job_id":"0c39639e-39a1-4f99-9531-d26565608a3a","html_url":"https://github.com/MicahParks/jwkset","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fjwkset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fjwkset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fjwkset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicahParks%2Fjwkset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicahParks","download_url":"https://codeload.github.com/MicahParks/jwkset/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","jwk","jwks","jwks-endpoint","jwks-rsa","jwkset","rfc7517"],"created_at":"2025-01-13T00:28:06.885Z","updated_at":"2025-04-09T06:13:09.259Z","avatar_url":"https://github.com/MicahParks.png","language":"Go","funding_links":["https://github.com/sponsors/MicahParks"],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/MicahParks/jwkset.svg)](https://pkg.go.dev/github.com/MicahParks/jwkset)\n\n# JWK Set (JSON Web Key Set)\n\nThis is a JWK Set (JSON Web Key Set) implementation written in Golang.\n\nThe goal of this project is to provide a complete implementation of JWK and JWK Sets within the constraints of the\nGolang standard library, without implementing any cryptographic algorithms. For example, `Ed25519` is supported, but\n`Ed448` is not, because the Go standard library does not have a high level implementation of `Ed448`.\n\nIf you would like to generate or validate a JWK without writing any Golang code, please visit\nthe [Generate a JWK Set](#generate-a-jwk-set) section.\n\nIf you would like to have a JWK Set client to help verify JWTs without writing any Golang code, you can use the\n[JWK Set Client Proxy (JCP) project](https://github.com/MicahParks/jcp) perform JWK Set client operations in the\nlanguage of your choice using an OpenAPI interface.\n\n# Generate a JWK Set\n\nIf you would like to generate a JWK Set without writing Golang code, this project publishes utilities to generate a JWK\nSet from:\n\n* PEM encoded X.509 Certificates\n* PEM encoded public keys\n* PEM encoded private keys\n\nThe PEM block type is used to infer which key type to decode. Reference the [Supported keys](#supported-keys) section\nfor a list of supported cryptographic key types.\n\n## Website\n\nVisit [https://jwkset.com](https://jwkset.com) to use the web interface for this project. You can self-host this website\nby following the instructions in the `README.md` in\nthe [website](https://github.com/MicahParks/jwkset/tree/master/website) directory.\n\n## Command line\n\nGather your PEM encoded keys or certificates and use the `cmd/jwkset` command line tool to generate a JWK Set.\n\n**Install**\n\n```\ngo install github.com/MicahParks/jwkset/cmd/jwkset@latest\n```\n\n**Usage**\n\n```\njwkset mykey.pem mycert.crt\n```\n\n## Custom server\n\nThis project can be used in creating a custom JWK Set server. A good place to start is `examples/http_server/main.go`.\n\n# Golang JWK Set client\n\nIf you are using [`github.com/golang-jwt/jwt/v5`](https://github.com/golang-jwt/jwt) take a look\nat [`github.com/MicahParks/keyfunc/v3`](https://github.com/MicahParks/keyfunc).\n\nThis project can be used to create JWK Set clients. An HTTP client is provided. See a snippet of the usage\nfrom `examples/default_http_client/main.go` below.\n\n## Create a JWK Set client from the server's HTTP URL.\n\n```go\njwks, err := jwkset.NewDefaultHTTPClient([]string{server.URL})\nif err != nil {\n\tlog.Fatalf(\"Failed to create client JWK set. Error: %s\", err)\n}\n```\n\n## Read a key from the client.\n\n```go\njwk, err = jwks.KeyRead(ctx, myKeyID)\nif err != nil {\n\tlog.Fatalf(\"Failed to read key from client JWK set. Error: %s\", err)\n}\n```\n\n# Supported keys\n\nThis project supports the following key types:\n\n* [Edwards-curve Digital Signature Algorithm (EdDSA)](https://en.wikipedia.org/wiki/EdDSA) (Ed25519 only)\n    * Go Types: `ed25519.PrivateKey` and `ed25519.PublicKey`\n* [Elliptic-curve Diffie–Hellman (ECDH)](https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman) (X25519\n  only)\n    * Go Types: `*ecdh.PrivateKey` and `*ecdh.PublicKey`\n* [Elliptic Curve Digital Signature Algorithm (ECDSA)](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)\n    * Go Types: `*ecdsa.PrivateKey` and `*ecdsa.PublicKey`\n* [Rivest–Shamir–Adleman (RSA)](https://en.wikipedia.org/wiki/RSA_(cryptosystem))\n    * Go Types: `*rsa.PrivateKey` and `*rsa.PublicKey`\n* [HMAC](https://en.wikipedia.org/wiki/HMAC), [AES Key Wrap](https://en.wikipedia.org/wiki/Key_Wrap), and other\n  symmetric keys\n    * Go Type: `[]byte`\n\nCryptographic keys can be added, deleted, and read from the JWK Set. A JSON representation of the JWK Set can be created\nfor hosting via HTTPS. This project includes an in-memory storage implementation, but an interface is provided for more\nadvanced use cases.\n\n# Notes\n\nThis project aims to implement the relevant RFCs to the fullest extent possible using the Go standard library, but does\nnot implement any cryptographic algorithms itself.\n\n* RFC 8037 adds support for `Ed448`, `X448`, and `secp256k1`, but there is no Golang standard library support for these\n  key types.\n* In order to be compatible with non-RFC compliant JWK Set providers, this project does not strictly enforce JWK\n  parameters that are integers and have extra or missing leading padding. See the release notes\n  of [`v0.5.15`](https://github.com/MicahParks/jwkset/releases/tag/v0.5.15) for details.\n* `Base64url Encoding` requires that all trailing `=` characters be removed. This project automatically strips any\n  trailing `=` characters in an attempt to be compatible with improper implementations of JWK.\n* This project does not currently support JWK Set encryption using JWE. This would involve implementing the relevant JWE\n  specifications. It may be implemented in the future if there is interest. Open a GitHub issue to express interest.\n\n# Related projects\n\n## [`github.com/MicahParks/keyfunc`](https://github.com/MicahParks/keyfunc)\n\nA JWK Set client for the [`github.com/golang-jwt/jwt/v5`](https://github.com/golang-jwt/jwt) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicahparks%2Fjwkset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicahparks%2Fjwkset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicahparks%2Fjwkset/lists"}