Add text messages encryption
This commit is contained in:
parent
4a41ea9e27
commit
5249d26588
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue