def cert_from_key_info_dict(key_info, ignore_age=False):
 res = []
 if (not ('x509_data' in key_info)):
  return 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

def cert_from_key_info_dict ( key_info , ignore_age = False ) : res = [ ] if ( not ( 'x509_data' in key_info ) ) : return 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
get all x509 certs from a keyinfo dictionary .