def PEM_split(cert_pem):
    """Split a certificate / certificate chain in PEM format into multiple
    PEM certificates.  This is useful for extracting the last / root PEM cert
    in a chain for example.  Will return a list of strings with each string
    being an individual PEM certificate (including its '-----BEGIN CERTIFICATE...'
    delineaters).
    """
    # Split cert based on begin certificate sections, then reconstruct as an
    # array of individual cert strings.
    delineator = '-----BEGIN CERTIFICATE-----'
    return ["{0}{1}".format(delineator, x) for x in cert_pem.strip().split(delineator) if x != '']