def METHOD_NAME(pem):
    if isinstance(pem, str):
        pem = pem.encode()
    d = b''.join([l.strip() for l in pem.split(b'\n')
                    if l and not l.startswith(b'-----')])
    return base64.b64decode(d)