From: W. Trevor King Date: Sat, 21 Apr 2012 17:31:33 +0000 (-0400) Subject: Update send-pgp-mime.py to use the new signer-specification API. X-Git-Tag: v0.3~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dd613ce7ae93a307d2dfe0ae3a6748ebeb0b4a6a;p=pgp-mime.git Update send-pgp-mime.py to use the new signer-specification API. --- 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: