convert the key in MIME encoded form in python
Posted
by jaysh
on Stack Overflow
See other posts from Stack Overflow
or by jaysh
Published on 2009-09-14T04:32:34Z
Indexed on
2010/03/31
5:03 UTC
Read the original article
Hit count: 187
this is the code :
f = urllib.urlopen('http://pool.sks-keyservers.net:11371/pks/lookup?op=get&search= 0x58e9390daf8c5bf3') #Retrieve the public key from PKS
data = f.read()
decoded_bytes = base64.b64decode(data)
print decoded_bytes
i need to convert the key in MIME encoded form which is presently comes in (ascii armored) radix 64 format.for that i have to get this radix64 format in its binary form and also need to remove its header and checksum than coversion in MIME format but i didnt find any method which can do this conversion.
i used the base64.b64decode method and its give me error:
Traceback (most recent call last): File "RetEnc.py", line 12, in ? decoded_bytes = base64.b64decode(data) File "/usr/lib/python2.4/base64.py", line 76, in b64decode raise TypeError(msg) TypeError: Incorrect padding
what to do i'didnt getting .can anybody suggest me something related to this......
thanks!!!!
© Stack Overflow or respective owner