<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cert_from_key_info(key_info, ignore_age=False):
 """ Get all X509 certs from a KeyInfo instance. Care is taken to make sure that the certs are continues sequences of bytes. All certificates appearing in an X509Data element MUST relate to the validation key by either containing it or being part of a certification chain that terminates in a certificate containing the validation key. :param key_info: The KeyInfo instance :return: A possibly empty list of certs """

    res = []
    for x509_data in key_info.x509_data:
        x509_certificate = x509_data.x509_certificate
        cert = x509_certificate.text.strip()
        cert = '\n'.join(split_len(''.join([s.strip() for s in
                                            cert.split()]), 64))
        if ignore_age or active_cert(cert):
            res.append(cert)
        else:
            logger.info('Inactive cert')
    return res