Closed mihai-chiorean closed 6 months ago
taking the following DID doc as an example:
{ "id": "did:dht:cwxob5rbhhu3z9x3gfqy6cthqgm6ngrh4k8s615n7pw11czoq4fy", "verificationMethod": [ { "id": "did:dht:cwxob5rbhhu3z9x3gfqy6cthqgm6ngrh4k8s615n7pw11czoq4fy#0", "type": "JsonWebKey2020", "controller": "did:dht:cwxob5rbhhu3z9x3gfqy6cthqgm6ngrh4k8s615n7pw11czoq4fy", "publicKeyJwk": { "crv": "Ed25519", "kty": "OKP", "alg": "EdDSA", "kid": "0", "x": "ZR8A7IHnJ5v9-TFcDzI8cZfhGJzSj29LYutpKTLwdoo" } } ], "authentication": [ "#0" ], "assertionMethod": [ "#0" ], "capabilityInvocation": [ "#0" ], "capabilityDelegation": [ "#0" ] }
if we do PublicKeyToBytes and then BytesToPublicKey the result for the verification method would be missing the alg key. it would look like
PublicKeyToBytes
BytesToPublicKey
alg
{ ... "publicKeyJwk": { "crv": "Ed25519", "kty": "OKP", "kid": "0", "x": "ZR8A7IHnJ5v9-TFcDzI8cZfhGJzSj29LYutpKTLwdoo" } ... }
taking the following DID doc as an example:
if we do
PublicKeyToBytes
and thenBytesToPublicKey
the result for the verification method would be missing thealg
key. it would look like