{"id":35749301,"url":"https://github.com/evan361425/ts-jose","last_synced_at":"2026-03-10T02:28:53.197Z","repository":{"id":37182106,"uuid":"360781464","full_name":"evan361425/ts-jose","owner":"evan361425","description":"Wrap functions of JOSE in steady interface","archived":false,"fork":false,"pushed_at":"2026-02-01T00:05:18.000Z","size":221,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-03T06:54:58.308Z","etag":null,"topics":["jose","jwe","jws","jwt","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evan361425.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-23T06:12:27.000Z","updated_at":"2026-02-01T00:05:22.000Z","dependencies_parsed_at":"2023-10-15T22:41:51.199Z","dependency_job_id":"a1865fa9-02b1-4c89-a0be-056fcc90e308","html_url":"https://github.com/evan361425/ts-jose","commit_stats":{"total_commits":181,"total_committers":4,"mean_commits":45.25,"dds":0.4696132596685083,"last_synced_commit":"993eab484329b621fb8825f492dc40af9b66cd23"},"previous_names":[],"tags_count":105,"template":false,"template_full_name":"evan361425/template-node-ts","purl":"pkg:github/evan361425/ts-jose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evan361425%2Fts-jose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evan361425%2Fts-jose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evan361425%2Fts-jose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evan361425%2Fts-jose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evan361425","download_url":"https://codeload.github.com/evan361425/ts-jose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evan361425%2Fts-jose/sbom","scorecard":{"id":385430,"data":{"date":"2025-08-11","repo":{"name":"github.com/evan361425/ts-jose","commit":"04ce41baf235ca314cca2487a1a40b07953c38e3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish-to-npm.yml:1","Warn: no topLevel permission defined: .github/workflows/sync-jose.yaml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-npm.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/publish-to-npm.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-npm.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/publish-to-npm.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:121: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:128: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:146: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:156: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sync-jose.yaml:163: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/sync-jose.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/evan361425/ts-jose/test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/publish-to-npm.yml:41","Warn: npmCommand not pinned by hash: .github/workflows/sync-jose.yaml:108","Warn: npmCommand not pinned by hash: .github/workflows/sync-jose.yaml:109","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:34","Warn: npmCommand not pinned by hash: .github/workflows/test.yml:51","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   9 third-party GitHubAction dependencies pinned","Info:   0 out of   5 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish-to-npm.yml:16"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T16:28:59.828Z","repository_id":37182106,"created_at":"2025-08-18T16:28:59.828Z","updated_at":"2025-08-18T16:28:59.828Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["jose","jwe","jws","jwt","typescript"],"created_at":"2026-01-06T19:09:07.990Z","updated_at":"2026-03-06T02:59:21.492Z","avatar_url":"https://github.com/evan361425.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TS JOSE\n\n![Node Version](https://img.shields.io/node/v/ts-jose)\n[![Version](https://img.shields.io/npm/v/ts-jose)](https://www.npmjs.com/package/ts-jose)\n[![codecov](https://codecov.io/gh/evan361425/ts-jose/branch/master/graph/badge.svg)](https://codecov.io/gh/evan361425/ts-jose)\n[![License](https://img.shields.io/github/license/evan361425/ts-jose)](LICENSE)\n\nWrap functions of [JOSE](https://github.com/panva/jose) in steady interface.\n\n\u003e [!Note]\n\u003e\n\u003e This package's version **will follow the version of JOSE** but should not\n\u003e provide any breaking changes.\n\n- [JWT](#jwt)\n  - [verify](#verify)\n  - [sign](#sign)\n  - [decrypt](#decrypt)\n  - [encrypt](#encrypt)\n- [JWS](#jws)\n  - [verify](#verify-1)\n  - [sign](#sign-1)\n- [JWE](#jwe)\n  - [decrypt](#decrypt-1)\n  - [encrypt](#encrypt-1)\n- [JWK](#jwk)\n- [JWKS](#jwks)\n\n## JWT\n\n### verify\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jwt/verify/interfaces/JWTVerifyOptions.md)\n\nAdditional options\n\n| name | Description                  |\n| ---- | ---------------------------- |\n| kid  | Using specific key in `JWKS` |\n| jti  | Verify payload `jti`         |\n\n```ts\n// `key` must be JWK or JWKS.\nawait JWT.verify(token, key, options);\n// Use embedded key instead given one.\nawait JWT.verify(token, undefined, options);\n```\n\n### sign\n\n- [JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jwt/sign/classes/SignJWT.md)\n\nUsing JOSE options\n\n| name      | Referrer          |\n| --------- | ----------------- |\n| issuer    | setIssuer         |\n| audience  | setAudience       |\n| subject   | setSubject        |\n| exp       | setExpirationTime |\n| jti       | setJti            |\n| notBefore | setNotBefore      |\n| iat       | setIssuedAt       |\n| typ       | Header            |\n| kid       | Header            |\n| alg       | Header            |\n\nAdditional options\n\n| name | type      | default | description                    |\n| ---- | --------- | ------- | ------------------------------ |\n| jwk  | _boolean_ | `false` | Whether embedded key to header |\n\n```ts\nawait JWT.sign(payload, key, options); // key must be JWK or JWKS\n```\n\n### decrypt\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jwt/decrypt/interfaces/JWTDecryptOptions.md)\n\nAdditional options\n\n| name | Description                  |\n| ---- | ---------------------------- |\n| kid  | Using specific key in `JWKS` |\n| enc  | Encrypt algorithm            |\n| alg  | Key management algorithm     |\n\n```ts\nawait JWT.decrypt(cypher, key, options);\n```\n\n### encrypt\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jwt/encrypt/classes/EncryptJWT.md)\n\nUsing JOSE options\n\n| name      | Referrer          |\n| --------- | ----------------- |\n| issuer    | setIssuer         |\n| audience  | setAudience       |\n| subject   | setSubject        |\n| exp       | setExpirationTime |\n| jti       | setJti            |\n| notBefore | setNotBefore      |\n| iat       | setIssuedAt       |\n| typ       | Header            |\n| kid       | Header            |\n| enc       | Header            |\n| alg       | Header            |\n\n```ts\nawait JWT.encrypt(payload, key, options);\n```\n\n## JWS\n\nYou can sign pure string.\n\n### verify\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jws/general/verify/functions/generalVerify.md)\n\n```ts\nawait JWS.verify(data, key, options);\n```\n\n### sign\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jws/general/sign/classes/GeneralSign.md)\n\nOnly using below [JWT.sign](#sign)'s options:\n\n- `typ`\n- `kid`\n- `alg`\n- `jwk`\n\n```ts\nawait JWS.sign('some-data', key, options);\n```\n\n## JWE\n\nYou can encrypt pure string.\n\n### decrypt\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jwe/general/decrypt/functions/generalDecrypt.md)\n\nAdditional options\n\nSame as [JWT.decrypt](#decrypt)\n\n```ts\nawait JWE.decrypt(cypher, key, options);\n```\n\n### encrypt\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/jwe/general/encrypt/classes/GeneralEncrypt.md)\n\nOnly using below [JWT.encrypt](#encrypt)'s options:\n\n- `kid`\n- `alg`\n- `enc`\n\n```ts\nawait JWE.encrypt('some-data', key, options);\n```\n\n## JWK\n\n[JOSE ref](https://github.com/panva/jose/blob/v6.x/docs/key/import/functions/importJWK.md)\n\n```ts\n// generate key\nconst key: JWK = await JWK.generate('ES256', {\n  kid: 'some-id',\n  use: 'sig',\n  // crv: string, some algorithms need to add curve - EdDSA\n  // modulusLength: number, some algorithms need to add length - RSA\n});\n\n// object to JWK\nconst key: JWK = await JWK.fromObject({\n  kid: 'some-id',\n  alg: 'ES256',\n  kty: 'EC',\n  crv: 'P-256',\n  x: '123',\n  y: '456',\n  d: '789',\n});\n\n// JWK to object\nconst keyObject: JWKObject = key.toObject(false); // true to output private object, default: false\n\n// private JWK to public JWK\nconst newKey: JWK = await key.toPublic();\n\n// get key's status\nkey.isPrivate;\n\n// check key \"id\", \"use\", \"alg\"\ntry {\n  // return `this` if all pass\n  key.getKey({ kid: 'some-id', use: 'sig', alg: 'ES256' });\n} catch (err) {\n  // throw error if this key has different metadata from options\n}\n```\n\n## JWKS\n\n```ts\n// object to JWKS\nconst keys = await JWKS.fromObject({\n  keys: [\n    {\n      alg: 'ES256',\n      kty: 'EC',\n      x: '123',\n      y: '456',\n    },\n  ],\n});\n\n// get key from store in specific options\ntry {\n  const key: JWK = keys.getKey({ kid: 'some-id', use: 'sig', alg: 'ES256' });\n} catch (err) {\n  // throw error if not found\n}\nconst key: JWK = keys.getKeyByKid('some-id');\nconst key: JWK = keys.getKeyByUse('sig');\nconst key: JWK = keys.getKeyByAlg('ES256');\nconst publicKeys = await keys.toPublic();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevan361425%2Fts-jose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevan361425%2Fts-jose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevan361425%2Fts-jose/lists"}