Skip to content

Instantly share code, notes, and snippets.

@edstenson
Forked from badmetacoder/p12tobigquery.py
Created January 8, 2014 14:40
Show Gist options
  • Save edstenson/8317792 to your computer and use it in GitHub Desktop.
Save edstenson/8317792 to your computer and use it in GitHub Desktop.
import argparse
import base64
import urllib
import sys
# parse arguments
parser = argparse.ArgumentParser(description='Convert a .p12 file into a string a Google Big Query Push connector can use.')
parser.add_argument('-f', required=True, action='store', dest='fin',
help='the name of the .p12 file')
args = parser.parse_args()
with open(args.fin, 'r') as f:
p12 = f.read()
sys.stdout.write(urllib.quote(base64.b64encode(p12)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment