code: def cert_from_key_info(key_info, ignore_age=False):
      
      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
docs: 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