def _parse_file_key_certs(certificate_file, validate=False):
 while True:
  keycert_content = _read_until_keywords('dir-key-certification', certificate_file)
  block_end_prefix = PGP_BLOCK_END.split(' ', 1)[0]
  keycert_content += _read_until_keywords(block_end_prefix, certificate_file, True)
  if keycert_content:
   (yield stem.descriptor.networkstatus.KeyCertificate(bytes.join('', keycert_content), validate=validate))
  else:
   break

def _parse_file_key_certs ( certificate_file , validate = False ) : while True : keycert_content = _read_until_keywords ( 'dir-key-certification' , certificate_file ) block_end_prefix = PGP_BLOCK_END . split ( ' ' , 1 ) [ 0 ] keycert_content += _read_until_keywords ( block_end_prefix , certificate_file , True ) if keycert_content : ( yield stem . descriptor . networkstatus . KeyCertificate ( bytes . join ( '' , keycert_content ) , validate = validate ) ) else : break
parses a file containing one or more authority key certificates .