add trim leading function
This commit is contained in:
parent
efc003288c
commit
701f1bc60a
3 changed files with 23 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue