Fix padding in b64_encode()
Bufixes in certificate decode/encode routine