Add text messages encryption

This commit is contained in:
Aron Wussler 2019-09-12 11:58:09 +02:00
parent 4a41ea9e27
commit 5249d26588

View file

@ -15,7 +15,7 @@ import (
// * message : The plaintext input as a PlainMessage // * message : The plaintext input as a PlainMessage
// * privateKey : (optional) an unlocked private keyring to include signature in the message // * privateKey : (optional) an unlocked private keyring to include signature in the message
func (keyRing *KeyRing) Encrypt(message *PlainMessage, privateKey *KeyRing) (*PGPMessage, error) { func (keyRing *KeyRing) Encrypt(message *PlainMessage, privateKey *KeyRing) (*PGPMessage, error) {
encrypted, err := asymmetricEncrypt(message.GetBinary(), keyRing, privateKey, true) encrypted, err := asymmetricEncrypt(message.GetBinary(), keyRing, privateKey, message.IsBinary())
if err != nil { if err != nil {
return nil, err return nil, err
} }