From dd613ce7ae93a307d2dfe0ae3a6748ebeb0b4a6a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Apr 2012 13:31:33 -0400 Subject: [PATCH] Update send-pgp-mime.py to use the new signer-specification API. --- bin/send-pgp-mime.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/send-pgp-mime.py b/bin/send-pgp-mime.py index 14ae501..eaa359b 100755 --- a/bin/send-pgp-mime.py +++ b/bin/send-pgp-mime.py @@ -143,15 +143,20 @@ if __name__ == '__main__': for attachment in args.attachment: body.attach(load_attachment( filename=attachment, encoding=args.encoding)) + if args.sign_as: + signers = [args.sign_as] + else: + signers = None if 'encrypt' in args.mode: recipients = [email for name,email in _pgp_mime.email_targets(header)] if args.mode == 'sign': - body = _pgp_mime.sign(body, sign_as=args.sign_as) + body = _pgp_mime.sign(body, signers=signers, allow_default_signer=True) elif args.mode == 'encrypt': body = _pgp_mime.encrypt(body, recipients=recipients) elif args.mode == 'sign-encrypt': body = _pgp_mime.sign_and_encrypt( - body, sign_as=args.sign_as, recipients=recipients) + body, signers=signers, recipients=recipients, + allow_default_signer=True) elif args.mode == 'plain': pass else: -- 2.26.2