def convert_pkcs7_bytes_to_pem(certs_pkcs7):
    """
    Given a list of certificates in pkcs7 encoding (bytes), covert them into a list of PEM encoded files
    :raises ValueError or ValidationError
    :param certs_pkcs7:
    :return: list of certs in PEM format
    """

    certificates = pkcs7.load_pem_pkcs7_certificates(certs_pkcs7)
    certificates_pem = []
    for cert in certificates:
        certificates_pem.append(pem.parse(cert.public_bytes(encoding=Encoding.PEM))[0])

    return certificates_pem

    Given a list of certificates in pkcs7 encoding (bytes), covert them into a list of PEM encoded files
    :raises ValueError or ValidationError
    :param certs_pkcs7:
    :return: list of certs in PEM format
    
lemur/common/utils.py