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.
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 used the base64.b64decode method and it gives me the following 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
Why am I get this TypeError: Incorrect padding
error, and how cn I fix it?