From 686d4f1b7dfb2fd57594baaf528e799425ce1cad Mon Sep 17 00:00:00 2001 From: Jakub Lehotsky Date: Thu, 22 Nov 2018 00:01:18 +0100 Subject: [PATCH] Medning wrong commit --- crypto/message.go | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/crypto/message.go b/crypto/message.go index 884936a..8f140ad 100644 --- a/crypto/message.go +++ b/crypto/message.go @@ -214,36 +214,6 @@ func (pm *PmCrypto) EncryptMessage(plainText string, publicKey *KeyRing, private return outBuf.String(), nil } -//EncryptMessageWithPassword encrypt a plain text to pgp message with a password -//plainText string: clear text -//output string: armored pgp message -func (pm *PmCrypto) EncryptMessageWithPassword(plainText string, password string) (string, error) { - - var outBuf bytes.Buffer - w, err := armor.Encode(&outBuf, armorUtils.MESSAGE_HEADER, internal.ArmorHeaders) - if err != nil { - return "", err - } - - config := &packet.Config{Time: pm.getTimeGenerator()} - plaintext, err := openpgp.SymmetricallyEncrypt(w, []byte(password), nil, config) - if err != nil { - return "", err - } - message := []byte(plainText) - _, err = plaintext.Write(message) - if err != nil { - return "", err - } - err = plaintext.Close() - if err != nil { - return "", err - } - w.Close() - - return outBuf.String(), nil -} - //DecryptMessageWithPassword decrypt a pgp message with a password //encrypted string : armored pgp message //output string : clear text