projects
/
platform
/
upstream
/
crda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ba1095
)
allow key2pub.py to read public pem files too
author
Johannes Berg
<johannes@sipsolutions.net>
Sat, 24 May 2008 17:34:54 +0000
(19:34 +0200)
committer
Johannes Berg
<johannes@sipsolutions.net>
Sat, 24 May 2008 17:34:54 +0000
(19:34 +0200)
key2pub.py
patch
|
blob
|
history
diff --git
a/key2pub.py
b/key2pub.py
index
0bfb4e4
..
477bc87
100755
(executable)
--- a/
key2pub.py
+++ b/
key2pub.py
@@
-101,7
+101,10
@@
if not mode in modes:
# load key
idx = 0
for f in files:
- key = RSA.load_key(f)
+ try:
+ key = RSA.load_pub_key(f)
+ except RSA.RSAError:
+ key = RSA.load_key(f)
modes[mode][0]('e_%d' % idx, key.e[4:])
modes[mode][0]('n_%d' % idx, key.n[4:])