fix: refactor DID:web key generation to use agent wallet#431
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors DID:web key generation to use the Credo TS agent's wallet for key creation and storage, removing the dependency on the ts-jose library. The change enhances security by ensuring keys are generated and stored directly in the agent's secure wallet rather than being temporarily held in memory.
Key Changes:
- Generate signing and encryption keys directly through the agent's wallet API instead of using
ts-jose - Remove the need to import private keys after generation since they're already stored in the wallet
- Eliminate the
extractKeyComponentshelper method and related private key handling code
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/utils/didWebGenerator.ts | Refactored to use agent.wallet.createKey() for key generation, removed ts-jose imports and helper methods, simplified importDidWeb() to no longer pass privateKeys |
| package.json | Removed ts-jose dependency and bumped version to 0.16.15 |
jonmattgray
reviewed
Dec 16, 2025
jonmattgray
approved these changes
Dec 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Checklist
PR Type
Please delete options that are irrelevant.
Linked tickets
High level description
Generate signing keys from agent's wallet to remove dependency on
ts-joseand back-importing of generated keysDetailed description
AI-assisted change to generate DID document's signing keys from agent wallet for guaranteed storage in the agent, enhanced privacy (keys not calculated or stored in memory, private keys not exposed), and reduced complexity by removing helper methods.
Refactored to in-line did document
importmethod after generation.Enhanced unit test for signing key and encryption key verification.
Use credo-ts native filtering for did lookup.
Describe alternatives you've considered
Operational impact
No functional changes
Additional context