{"id":20261904,"url":"https://github.com/nodesolidserver/keychain","last_synced_at":"2025-12-26T20:59:23.077Z","repository":{"id":49612070,"uuid":"136373313","full_name":"nodeSolidServer/keychain","owner":"nodeSolidServer","description":"KeyChain for use with Web Cryptography API in Node.js","archived":false,"fork":false,"pushed_at":"2021-06-12T03:34:25.000Z","size":381,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-24T23:05:29.842Z","etag":null,"topics":["running-code"],"latest_commit_sha":null,"homepage":"","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/nodeSolidServer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-06T18:55:42.000Z","updated_at":"2024-06-13T01:15:55.000Z","dependencies_parsed_at":"2022-09-18T23:50:27.859Z","dependency_job_id":null,"html_url":"https://github.com/nodeSolidServer/keychain","commit_stats":null,"previous_names":["solid/keychain"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeSolidServer%2Fkeychain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeSolidServer%2Fkeychain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeSolidServer%2Fkeychain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeSolidServer%2Fkeychain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodeSolidServer","download_url":"https://codeload.github.com/nodeSolidServer/keychain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328104,"owners_count":21085258,"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":["running-code"],"created_at":"2024-11-14T11:27:34.902Z","updated_at":"2025-12-26T20:59:23.038Z","avatar_url":"https://github.com/nodeSolidServer.png","language":"JavaScript","readme":"# KeyChain for use with Web Cryptography API in Node.js\n\n## Usage\n\nInstall the package\n\n```bash\n$ npm install https://github.com/anvilresearch/keychain.git\n```\n\nLoad the module\n\n```javascript\nconst KeyChain = require('keychain')\n```\n\nCreate a new instance by passing a descriptive object to the `KeyChain` \nconstructor. This object can have any naming or nesting scheme, as long as the last nested object contains parameters describing key generation. At a bare minimum, this must include an `alg` property with a JWA algorithm name as its value. Currently, `RS256`, `RS384`, and `RS512` are supported. \n\n```javascript\nlet keys = new KeyChain({\n  a: { b: { alg: 'RS256' } },\n  c: { d: { alg: 'RS256' } },\n  e: { f: { alg: 'RS256', modulusLength: 2048 } // default is 4096\n}) \n```\n\nThis initialized a KeyChain instance but didn't generate keys. To generate keys \naccording to the object passed to the keychain, call `rotate()`. The `rotate()` \nmethod returns a promise for the keychain.\n\n```javascript\nkeys.rotate()\n```\n\nOnce keys have been generated, they can be accessed as CryptoKey or JWK objects, \naccording to the object structure defined by the caller.\n\nAccess CryptoKey objects for Web Crypto API operations:\n\n```javascript\nkeys.a.b.privateKey\nkeys.a.b.publicKey\n```\n\nAccess JWK objects:\n\n```javascript\nkeys.a.b.privateJwk\nkeys.a.b.publicJwk\n```\n\nKey rotation also generates a JWK Set in object and JSON form:\n\n```javascript\nkeys.jwks     // JWK Set object\nkeys.jwkSet   // JWK Set JSON string\n```\n\n## Running tests\n\n### Nodejs\n\n```bash\n$ npm test\n```\n\n## MIT License\n\n[The MIT License](LICENSE.md)\n\nCopyright (c) 2016 Anvil Research, Inc.\nCopyright (c) 2017-2019 The Solid Project\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesolidserver%2Fkeychain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodesolidserver%2Fkeychain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodesolidserver%2Fkeychain/lists"}