Verification method to JWK conversion #290
Merged
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.
Internally we are using JWK to represent most kinds of keys, and are preferring to use publicKeyJwk in DID Documents where possible. But some verification method maps do not use
publicKeyJwk
but rather use others:publicKeyMultibase
is the main alternative, listed in DID Core. VMs using it typically use it with multicodec - as noted in its Security Vocabulary entry. Newer signature suites such as Ed25519 Signature 2020 use this one specifically. We are using it inTezosJcsSignature2021
(non-multicodec).publicKeyHex
is deprecated in W3C CCG Security Vocabularity, but is still often used with EcdsaSecp256k1VerificationKey2019. (Issue: DO NOT USE publicKeyHex w3c-ccg/lds-ecdsa-secp256k1-2019#4)publicKeyBase58
is similarly deprecated, but is often used withEd25519Signature2018
. (Discussion: Use of Multibase, Multicodec, and Multihash w3c-ccg/lds-ed25519-2018#3)We have a conversion function to allow using non-JWK verification material as JWK. This was added in #121, for compatibility with the
Ed25519Signature2018
did:web
issuer in the VC HTTP API Test Suite. This PR is similar, adding support forpublicKeyHex
and JWK conversion forEcdsaSecp256k1VerificationKey2019
. Additionally, tests are added.These changes should help enable compatibility with implementations and specifications that still rely on
publicKeyHex
, particularly in conjunction withEcdsaSecp256k1VerificationKey2019
.