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

fix: DIDCommV1: Routing keys & forward messages #45

Merged
merged 7 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions didcomm_messaging/v1/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ async def did_to_target(
self.vm_to_v1_kid(crypto, doc, recip) for recip in target.recipient_keys
]
routing_keys = [
self.vm_to_v1_kid(crypto, doc, routing_key)
crypto.public_key_to_v1_kid(
crypto.verification_method_to_public_key(
VerificationMethod(id=routing_key, type="Ed25519VerificationKey2020", controller=routing_key.split("#")[0], public_key_multibase=routing_key.split("#")[1])
)
)
dbluhm marked this conversation as resolved.
Show resolved Hide resolved
for routing_key in target.routing_keys
]
endpoint = target.service_endpoint
Expand Down Expand Up @@ -187,7 +191,7 @@ async def pack(
encoded_message = await packaging.pack(
crypto,
secrets,
self.forward_wrap(forward_to, encoded_message.to_json()),
self.forward_wrap(forward_to, encoded_message.serialize()),
[routing_key],
)
forward_to = routing_key
Expand Down
Loading