(no commit message)
[sfa.git] / gui / JavaApplication1 / certutil.py
1 #!/usr/bin/python
2 from M2Crypto import X509
3 import sys
4
5 id_file = ""
6 try:
7     if len(sys.argv)>1:
8         id_file = sys.argv[len(sys.argv)-1]
9     else:
10         print 'File '+id_file+' does not exist.\n'
11         sys.exit(0)
12     pubkey = X509.load_cert(id_file).get_pubkey().as_pem(cipher=None)
13     print pubkey
14     
15     print "Character map:\n"
16     prev = ''
17     cur = ''
18     for ch in pubkey:
19         prev = cur
20         cur = ch
21         if cur == '\n':
22             1==1
23         print ch,
24 except:
25     print "Error in input file.\n"