{"id":30703288,"url":"https://github.com/deatil/go-jwt-gm","last_synced_at":"2025-09-02T16:58:42.057Z","repository":{"id":301589508,"uuid":"1009740271","full_name":"deatil/go-jwt-gm","owner":"deatil","description":"A JWT GM(China GuoMi) driver library for go-jwt.","archived":false,"fork":false,"pushed_at":"2025-06-27T16:59:23.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T17:32:53.288Z","etag":null,"topics":["gm","jws","jwt","jwt-gm","sm2","sm3"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/deatil/go-jwt-gm","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/deatil.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":"2025-06-27T16:21:40.000Z","updated_at":"2025-06-27T16:57:46.000Z","dependencies_parsed_at":"2025-06-27T17:34:56.126Z","dependency_job_id":"0c781233-33f4-4649-8363-e4c6f2ea4059","html_url":"https://github.com/deatil/go-jwt-gm","commit_stats":null,"previous_names":["deatil/go-jwt-gm"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/deatil/go-jwt-gm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-jwt-gm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-jwt-gm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-jwt-gm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-jwt-gm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/go-jwt-gm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-jwt-gm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273317756,"owners_count":25084037,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gm","jws","jwt","jwt-gm","sm2","sm3"],"created_at":"2025-09-02T16:58:33.354Z","updated_at":"2025-09-02T16:58:42.033Z","avatar_url":"https://github.com/deatil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## go-jwt-gm\n\n\n### Desc\n\n*  A JWT GM(China GuoMi) driver library for go.\n\n\n### Download\n\n~~~go\ngo get -u github.com/deatil/go-jwt-gm\n~~~\n\n\n### Get Starting\n\n~~~go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/deatil/go-jwt-gm/jwt\"\n)\n\nfunc main() {\n    claims := map[string]string{\n        \"aud\": \"example.com\",\n        \"sub\": \"foo\",\n    }\n    key := []byte(\"test-key\")\n\n    s := jwt.SigningMethodHSM3.New()\n    tokenString, err := s.Sign(claims, key)\n    if err != nil {\n        fmt.Printf(\"Sign: %s \\n\", err.Error())\n        return\n    }\n\n    fmt.Printf(\"Signed: %s \\n\", tokenString)\n\n    p := jwt.SigningMethodHSM3.New()\n    parsed, err := p.Parse(tokenString, key)\n    if err != nil {\n        fmt.Printf(\"Parse: %s \\n\", err.Error())\n        return\n    }\n\n    claims2, err := parsed.GetClaims()\n    if err != nil {\n        fmt.Printf(\"GetClaims: %s \\n\", err.Error())\n        return\n    }\n\n    aud := claims2[\"aud\"].(string)\n    fmt.Printf(\"Parseed aud: %s \\n\", aud)\n}\n~~~\n\n\n### Signing Methods\n\nThe JWT GM driver library have signing methods:\n\n - `HSM3`: jwt.SigningMethodHSM3\n - `GmSM2`: jwt.SigningMethodGmSM2\n - `ES256K`: jwt.SigningMethodES256K\n\n\n### LICENSE\n\n*  The library LICENSE is `Apache2`, using the library need keep the LICENSE.\n\n\n### Copyright\n\n*  Copyright deatil(https://github.com/deatil).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fgo-jwt-gm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fgo-jwt-gm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fgo-jwt-gm/lists"}