{"id":44040202,"url":"https://github.com/nuts-foundation/jwt-generator","last_synced_at":"2026-02-07T20:34:23.441Z","repository":{"id":97478403,"uuid":"596455958","full_name":"nuts-foundation/jwt-generator","owner":"nuts-foundation","description":"A JWT generator for authenticating to nuts-node services","archived":false,"fork":false,"pushed_at":"2025-04-22T12:29:03.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T13:42:07.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nuts-foundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2023-02-02T08:14:16.000Z","updated_at":"2025-04-22T12:28:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"e5ee576d-a0b9-4958-994a-cd6acf2fa5f1","html_url":"https://github.com/nuts-foundation/jwt-generator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nuts-foundation/jwt-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuts-foundation%2Fjwt-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuts-foundation%2Fjwt-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuts-foundation%2Fjwt-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuts-foundation%2Fjwt-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuts-foundation","download_url":"https://codeload.github.com/nuts-foundation/jwt-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuts-foundation%2Fjwt-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29208161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T20:33:12.493Z","status":"ssl_error","status_checked_at":"2026-02-07T20:30:47.381Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-07T20:34:22.840Z","updated_at":"2026-02-07T20:34:23.434Z","avatar_url":"https://github.com/nuts-foundation.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nuts-jwt-generator\nnuts-jwt-generator is a utility for generating tokens to authenticate to [token_v2](https://nuts-node.readthedocs.io/en/stable/pages/deployment/production-configuration.html#authentication) protected nuts-node APIs. The tokens are compact encoded JWTs (JSON Web Tokens) which are signed by a known cryptography key. The keys permitted to create valid tokens are configured on the nuts node.\n\n## Installing\nTo install the tool download a binary from the github releases page.\n\nOn a MacOS/Linux system you can copy/paste the URL of the binary, replacing $BINARY_URL in the following command:\n```\ncurl --fail -L -o /usr/local/bin/nuts-jwt-generator $BINARY_URL\nchmod +x /usr/local/bin/nuts-jwt-generator\n```\n\n## Supported Keys\nThe following key algorithms are supported:\n- Ed25519\n- ECDSA P-256, P-384, P-521\n- RSA 2048-bit, 3072-bit, 4096-bit\n\nThe following key file formats are supported:\n- OpenSSH\n- JWK\n- PEM\n\n## Usage\n\n### To create a JWT using an SSH private key file\n```\nnuts-jwt-generator -i ~/.ssh/id_nutsapi --host nuts-server-001\n```\n\n### To create a JWT using a key loaded in ssh-agent\n```\nnuts-jwt-generator -i ~/.ssh/id_agentkey.pub --host nuts-server-001\n```\n\n### To create a JWT using a PEM private key file\n```\nnuts-jwt-generator -i ~/.nuts/apikey.pem --host nuts-server-001\n```\n\n### To create a JWT using a JWK private key file\n```\nnuts-jwt-generator -i ~/.nuts/apikey.jwk --host nuts-server-001\n```\n\n### Generating the SSH SHA256 Fingerprint of a Key\n```\nnuts-jwt-generator -i \u003cpath-to-key\u003e --export-ssh-fingerprint\n```\n\n### Generating the JWK Thumbprint of a Key\n```\nnuts-jwt-generator -i \u003cpath-to-key\u003e --export-jwk-thumbprint\n```\n\n### Generating the SSH authorized_keys Form of a Key\n```\nnuts-jwt-generator -i \u003cpath-to-key\u003e --export-authorized-key\n```\n\n### Command Line Flags\n```\nUsage of nuts-jwt-generator:\n  -duration int\n        duration in seconds of the token validity (default 300)\n  -export-authorized-key\n        Export the authorized_keys format\n  -export-jwk-thumbprint\n        Export the JWK SHA256 thumbprint\n  -export-ssh-fingerprint\n        Export the SSH SHA256 fingerprint\n  -host string\n        hostname of nuts node, for aud field of JWT\n  -i string\n        key file path (private for internal signing, public for ssh-agent signing)\n  -list-agent\n        list SSH keys from ssh-agent\n  -quiet\n        disable logging output\n  -user string\n        username (default: key comment or current username/hostname)\n```\n\n## Development\n\n### Building\nTo build the tool locally checkout the repo and run:\n```\nmake build\n```\n\n### Building a release\nTo build a release for all supported architectures:\n```\nmake release\n```\n\n## Key Generation\nTo use this utility you must already be in possession of a compatible private key. The following commands can be used on Mac/Linux/Windows to generate keys.\n\n### Key Generation (OpenSSH)\nTo generate an Ed25519 key:\n```\nssh-keygen -t ed25519 -f \u003cpath-to-private-key\u003e\n```\n\nTo generate an ECDSA (P-521) key:\n```\nssh-keygen -t ecdsa -b 521 -f \u003cpath-to-private-key\u003e\n```\n\nTo generate an RSA (4096-bit) key:\n```\nssh-keygen -t rsa -b 4096 -f \u003cpath-to-private-key\u003e\n```\n\n### Key Generation (PEM/OpenSSL)\nTo generate an Ed25519 key:\n```\nopenssl genpkey -algorithm ed25519 -out \u003cpath-to-private-pem\u003e\nopenssl pkey -in \u003cpath-to-private-pem\u003e -pubout -out \u003cpath-to-public-pem\u003e\n```\n\nTo generate an ECDSA (P-521) key:\n```\nopenssl ecparam -name secp521r1 -genkey -noout -out \u003cpath-to-private-pem\u003e\nopenssl ec -in \u003cpath-to-private-pem\u003e -pubout -out \u003cpath-to-public-pem\u003e\n```\n\nTo generate an ECDSA (P-384) key:\n```\nopenssl ecparam -name secp384r1 -genkey -noout -out \u003cpath-to-private-pem\u003e\nopenssl ec -in \u003cpath-to-private-pem\u003e -pubout -out \u003cpath-to-public-pem\u003e\n```\n\nTo generate an ECDSA (P-256) key:\n```\nopenssl ecparam -name secp256k1 -genkey -noout -out \u003cpath-to-private-pem\u003e\nopenssl ec -in \u003cpath-to-private-pem\u003e -pubout -out \u003cpath-to-public-pem\u003e\n```\n\nTo generate an RSA (4096-bit) key:\n```\nopenssl genrsa -out \u003cpath-to-private-pem\u003e 4096\nopenssl rsa -in \u003cpath-to-private-pem\u003e -pubout -out \u003cpath-to-public-pem\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuts-foundation%2Fjwt-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuts-foundation%2Fjwt-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuts-foundation%2Fjwt-generator/lists"}