Last active
April 18, 2020 01:51
-
-
Save jschmidtnj/e9fbcd5fefe62469f2e9d211665b1ac2 to your computer and use it in GitHub Desktop.
keybase sign script to replace comment with /verify (makes it easier for recipients)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import argparse | |
| from subprocess import check_output | |
| # keybase sign message or file | |
| # replace comment with /verify so recipients can find it easily | |
| parser = argparse.ArgumentParser(description='Sign message.') | |
| parser.add_argument('-i', dest='file_path', default=None, | |
| help='file input', nargs=1) | |
| parser.add_argument('-m', dest='message', default=None, | |
| help='message input', nargs=1) | |
| def main(): | |
| args = parser.parse_args() | |
| if args.file_path is None and args.message is None: | |
| parser.print_help() | |
| return | |
| input_flag=None | |
| data=None | |
| if args.message is not None: | |
| input_flag = '-m' | |
| data = args.message[0] | |
| else: | |
| input_flag = '-i' | |
| data = args.file_path[0] | |
| result = check_output(['keybase', 'pgp', 'sign', \ | |
| input_flag, data]) | |
| result = result.decode("utf-8") | |
| result = result.replace('https://keybase.io/download', \ | |
| 'https://keybase.io/verify') | |
| print(result, end ='') | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment