def dePem(s, name):
    prefix  = "-----BEGIN %s-----" % name
    postfix = "-----END %s-----" % name    
    start = s.find(prefix)
    if start == -1:
        raise SyntaxError("Missing PEM prefix")
    end = s.find(postfix, start+len(prefix))
    if end == -1:
        raise SyntaxError("Missing PEM postfix")
    s = s[start+len("-----BEGIN %s-----" % name) : end]
    retBytes = a2b_base64(s) # May raise SyntaxError
    return retBytes
Decode a PEM string into a bytearray of its payload.
dataset/ETHPy150Open mrknow/filmkodi/plugin.video.specto/resources/lib/libraries/f4mproxy/utils/pem.py/dePem