note package’s Message type.
Installation
Our recommendation is to head over to the GOBL CLI releases page and download the latest version for your platform and copy the binary to a directory of your choosing. If you already have a working Go environment you may also find it easy to install the latest version with:Building a Message
The notes.Message type is great for setting up a simple test. For this tutorial open your text editor and a simple JSON file calledmessage.json that looks like:
build command with the --envelop and --draft flags indicating that we want a draft envelope of the message. The -i flag produces prettier output:
Keys
GOBL has built in support for digital signatures using JSON Web Keys. The CLI makes this process trivial, but you do need to have generated a private key. Thekeygen command will create a key pair inside the ~/.gobl directory by running:
Signing
Now we have a private key, we can sign the original message. Run the following command:doc and head fields are identical to the original message, but we’ve now added the sigs array at the end. Combined with your public key, anyone can easily verify the contents of your message where indeed signed with your private key.
If you’re interested, you can check the contents of the signature here: jwt.io.