@garrett It seems i managed to get it working.
I think it was a accumulation of different things together.
- At first i copied pasted the private and public keys into a textbox for testing. But i suspect there might have been an issue with the default encoding of strings. Now i have download them from the passbolt server as files and load the files at runtime with the correct encoding. However i do not use the public key file anymore, see point 2.
- I found in the Go sample that the users public key is downloaded from the Passbolt server after login. I changed my application to do the same, so i make sure that the public key is always correct for the logged in user.
- The significant length difference in the OpenPGP message between the Go sample and my application was because i needed to use a different encrypting function. I used the function EncryptStream, and i needed to use EncryptArmoredStringAndSign.
It might be one of these 3 points but after playing around with all 3 i managed to get it working. So i cannot be exactly sure. But my guess is that point 3 fixed it.
There is still quite a few things i need to add before the API implementation is done. But this was probably one of the toughest parts to go through. If i have the encrypting/decrypting sorted the rest is just making sure the API calls are correct.