Ricardo Cerqueira | 0a656b6 | 2013-10-01 20:42:45 +0100 | [diff] [blame] | 1 | #!/usr/bin/env python |
2 | |||||
3 | from __future__ import print_function | ||||
4 | |||||
5 | import base64 | ||||
6 | import sys | ||||
7 | |||||
8 | pkFile = open(sys.argv[1], 'rb').readlines() | ||||
9 | base64Key = "" | ||||
10 | inCert = False | ||||
11 | for line in pkFile: | ||||
12 | if line.startswith(b"-"): | ||||
13 | inCert = not inCert | ||||
14 | continue | ||||
15 | |||||
16 | base64Key += line.strip() | ||||
17 | |||||
18 | print(base64.b16encode(base64.b64decode(base64Key)).lower()) |