Skip to content

Commit

Permalink
fix did:dht identity key vm id (#83)
Browse files Browse the repository at this point in the history
Co-authored-by: Ethan Lee <[email protected]>
  • Loading branch information
mistermoe and ethan-tbd authored May 7, 2024
1 parent 44d0e96 commit 721fe23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/web5/lib/src/dids/did_dht/did_dht.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DidDht {
final did = 'did:$methodName:$id';

final identityVm = DidVerificationMethod(
id: '0',
id: '$did#0',
type: 'JsonWebKey',
controller: did,
publicKeyJwk: identityKey,
Expand Down
10 changes: 9 additions & 1 deletion packages/web5/test/jwt/jwt_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ void main() {
expect(parsedJwt.claims.iss, equals(did.uri));
});

test('should verify signed JWT', () async {
test('should verify JWT signed by did:jwk', () async {
final did = await DidJwk.create();

final signedJwt =
await Jwt.sign(did: did, payload: JwtClaims(iss: did.uri));

await Jwt.verify(signedJwt);
});

test('should verify signed JWT signed by did:dht', () async {
final did = await DidDht.create(publish: true);
final signedJwt =
await Jwt.sign(did: did, payload: JwtClaims(iss: did.uri));

await Jwt.verify(signedJwt);
});
});
}

0 comments on commit 721fe23

Please sign in to comment.