Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for Multikey #305

Merged
merged 1 commit into from
Jan 18, 2024
Merged

feat: add support for Multikey #305

merged 1 commit into from
Jan 18, 2024

Conversation

mirceanis
Copy link
Member

fixes #304

This PR adds support for Multikey verification methods, both for signature verification and for key agreement.
I also added a few internal mappings for known key types, verification methods, algorithms and multiformat codecs.

BREAKING CHANGE: The return types have changed for of extractPublicKeyBytes() and multibaseToBytes() from Uint8Arrays to Objects containing the keyBytes: Uint8Array and a decoded or inferred keyType: string | undefined

Merging this PR should trigger a major version bump

fixes #304

BREAKING CHANGE: The return types have changed for  of `extractPublicKeyBytes()` and `multibaseToBytes()` from Uint8Arrays to Objects containing the `keyBytes: Uint8Array` and a decoded or inferred `keyType: string | undefined`
Comment on lines +296 to +298
const possibleCodec: string | undefined =
Object.entries(supportedCodecs).filter(([, code]) => code === codec)?.[0][0] ?? ''
return { keyBytes: bytes.slice(length), keyType: CODEC_TO_KEY_TYPE[possibleCodec as KNOWN_CODECS] }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most relevant change

@mirceanis mirceanis merged commit 20bbc3e into master Jan 18, 2024
2 checks passed
@mirceanis mirceanis deleted the 304-support-multikey branch January 18, 2024 04:02
uport-automation-bot pushed a commit that referenced this pull request Jan 18, 2024
# [8.0.0](7.4.7...8.0.0) (2024-01-18)

### Features

* add support for Multikey ([#305](#305)) ([20bbc3e](20bbc3e)), closes [#304](#304)

### BREAKING CHANGES

* The return types have changed for  of `extractPublicKeyBytes()` and `multibaseToBytes()` from Uint8Arrays to Objects containing the `keyBytes: Uint8Array` and a decoded or inferred `keyType: string | undefined`
@uport-automation-bot
Copy link
Collaborator

🎉 This PR is included in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[proposal] add support for Multikey
3 participants