def split_pem(s):
 pem_strings = []
 while (s != ''):
  start_idx = s.find('-----BEGIN')
  if (start_idx == (-1)):
   break
  end_idx = s.find('-----END')
  end_idx = (s.find('\n', end_idx) + 1)
  pem_strings.append(s[start_idx:end_idx])
  s = s[end_idx:]
 return pem_strings

def split_pem ( s ) : pem_strings = [ ] while ( s != '' ) : start_idx = s . find ( '-----BEGIN' ) if ( start_idx == ( - 1 ) ) : break end_idx = s . find ( '-----END' ) end_idx = ( s . find ( '\n' , end_idx ) + 1 ) pem_strings . append ( s [ start_idx : end_idx ] ) s = s [ end_idx : ] return pem_strings
split pem objects .