add trim leading function

This commit is contained in:
zhj4478 2018-06-05 15:26:55 -07:00
parent efc003288c
commit 701f1bc60a
3 changed files with 23 additions and 1 deletions

View file

@ -227,6 +227,9 @@ func (o *OpenPGP) EncryptMessage(plainText string, publicKey string, privateKey
// passphrase : optional required when you pass the private key and this passphrase must could decrypt the private key
func (o *OpenPGP) EncryptMessageBinKey(plainText string, publicKey []byte, privateKey string, passphrase string, trim bool) (string, error) {
if trim {
plainText = trimNewlines(plainText)
}
var outBuf bytes.Buffer
w, err := armor.Encode(&outBuf, pgpMessageType, armorHeader)
if err != nil {