Closed tdiesler closed 1 year ago
Not sure how the dispatcher is supposed to work without to
and from
. The sicpa library provides an UnpackResult
with ...
encryptedTo=did:peer:2.Ez6LSsYLxdDAbZDrBs8rPxxh5yMBRFVqArfhsSBBqxXmcBCQU.Vz6MkjyGdybk4M8W59KsmStrf32Q1JZfsL521E6MaZ7qnmyom.SeyJ0IjoiZG0iLCJzIjoiaHR0cDovL2xvY2FsaG9zdDo5MDAwIn0#6LSsYLxdDAbZDrBs8rPxxh5yMBRFVqArfhsSBBqxXmcBCQU
_Message.to=did:peer:2.Ez6LSsYLxdDAbZDrBs8rPxxh5yMBRFVqArfhsSBBqxXmcBCQU.Vz6MkjyGdybk4M8W59KsmStrf32Q1JZfsL521E6MaZ7qnmyom.SeyJ0IjoiZG0iLCJzIjoiaHR0cDovL2xvY2FsaG9zdDo5MDAwIn0
____signFrom=did:peer:2.Ez6LSiWVFeDTzF8cp5WbdTjzQK2o8U9K2R8kzEwSbhJYUDEhH.Vz6MkiV6KXQC4sCgbrJ3uRctqC2zowqfaydc12Jas6StfWuT7.SeyJ0IjoiZG0iLCJzIjoiaHR0cDovL2xvY2FsaG9zdDo5MDAwIn0#6MkiV6KXQC4sCgbrJ3uRctqC2zowqfaydc12Jas6StfWuT7
Message.from=did:peer:2.Ez6LSiWVFeDTzF8cp5WbdTjzQK2o8U9K2R8kzEwSbhJYUDEhH.Vz6MkiV6KXQC4sCgbrJ3uRctqC2zowqfaydc12Jas6StfWuT7.SeyJ0IjoiZG0iLCJzIjoiaHR0cDovL2xvY2FsaG9zdDo5MDAwIn0
As you can see, the unpack results reference key ids (kids) into the DidDoc and not Did URIs. By convention these kids usually start with their respective Did URI, but that isn't required. In contrary, I found a section in the spec that explicitly states that a kid cannot be used to deduct anything. The only requirement is, that it is unique.
I could default to Message.to/from
and fallback to these kids with the #...
cut off.
Thoughts?
The SecretResolverService does this
I have after all, a way to get from a kid to a did
For encrypted messages, you can omit to
and from
.
For signed and plain messages, the routing info cannot be derived from the unpack results
(i.e. this needs to be defined on the message)