The issue with the example is that the public key for the receiver is obtained based on the secret key of the receiver. So the conversion process is:
saltpack.BoxSecretKey -> saltpack.BoxPublicKey
However in a real world application you don't have (and shouldn't have) the private key of the recipient. You only have the raw bytes of the public key. But going through the documentation I found that every constructor function or import function presupposes the possession of the private key, which we don't have.
So how can I encrypt a message when all I have is my own private key and the 32 byte array raw public key of the recipient?
I am trying to use the
EncryptArmor62Seal
function to encrypt a message for another party. I am following the example here:https://pkg.go.dev/github.com/keybase/saltpack@v0.0.0-20231213211625-726bb684c617#EncryptArmor62Seal
The issue with the example is that the public key for the receiver is obtained based on the secret key of the receiver. So the conversion process is:
saltpack.BoxSecretKey -> saltpack.BoxPublicKey
However in a real world application you don't have (and shouldn't have) the private key of the recipient. You only have the raw bytes of the public key. But going through the documentation I found that every constructor function or import function presupposes the possession of the private key, which we don't have.
So how can I encrypt a message when all I have is my own private key and the 32 byte array raw public key of the recipient?