{"id":15605515,"url":"https://github.com/tswayne/js-libtrust","last_synced_at":"2025-08-31T07:31:28.142Z","repository":{"id":73761358,"uuid":"317000394","full_name":"tswayne/js-libtrust","owner":"tswayne","description":"Javascript implementation of libtrust","archived":false,"fork":false,"pushed_at":"2020-11-29T18:00:13.000Z","size":2284,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-25T11:22:25.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tswayne.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}},"created_at":"2020-11-29T17:02:53.000Z","updated_at":"2023-11-26T17:44:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a02fa76-6987-45d1-b150-ef55dbf5e061","html_url":"https://github.com/tswayne/js-libtrust","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"ef3b857f7bbdd23fc54d0068c552cd111f56ccfb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fjs-libtrust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fjs-libtrust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fjs-libtrust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fjs-libtrust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tswayne","download_url":"https://codeload.github.com/tswayne/js-libtrust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231579999,"owners_count":18395374,"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":[],"created_at":"2024-10-03T04:07:48.199Z","updated_at":"2024-12-28T03:18:30.504Z","avatar_url":"https://github.com/tswayne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-libtrust\nJavascript implementation of docker's [libtrust](https://github.com/docker/libtrust) fingerprint, used for the key id header in the jwt used for dockr authentication.  The implementation follows the spec outlined in \ndocker's [token authentication implementation](https://docs.docker.com/registry/spec/auth/jwt/):\n```markdown\nThe “kid” field has to be in a libtrust fingerprint compatible format. Such a format can be generated by following steps:\n1. Take the DER encoded public key which the JWT token was signed against.\n2. Create a SHA256 hash out of it and truncate to 240bits.\n3. Split the result into 12 base32 encoded groups with : as delimiter.\n```\n\n## Usage\n```javascript\nconst fs = require('fs')\nconst libtrust = require('libtrust')\nconst publicKey = fs.readFileSync('certificate.crt', 'utf-8')\n\nconst keyId = libtrust.fingerprint(publicKey)\n```\n\n### Shout out\nBig shout out to @kyleburnett who cracked a few pieces to enable this javascript implementation. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftswayne%2Fjs-libtrust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftswayne%2Fjs-libtrust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftswayne%2Fjs-libtrust/lists"}