decentralized-identity / DIDComm-js

JS implementation of pack and unpack
Apache License 2.0
54 stars 25 forks source link

How to construct valid messages according to a protocol version? #14

Open OR13 opened 5 years ago

OR13 commented 5 years ago

The readme shows:

  const message = JSON.stringify({
        "@type": "did:example:1234567890;spec/test",
        data: "I AM A SIGNED MESSAGE"
    })

I would expect this library to assist implementers in crafting messages that are formatted correctly, in addition to packing / unpacking.

The code used to construct a valid message, is undoubtably in other repo, can establish a clearer understanding of the message format this library should be used with?

kdenhartog commented 5 years ago

The message format isn't a concern of this layer. As long as it's a string, this library can be used to encrypt the message.

However, with that said, "DIDComm semantic messages" are assumed to be the common messages used in this format. This is the reason that I included some with the format of DIDComm semantic messages and some without.