code: def process_pem(self, data, name):
          
          try:
              ret = []
              data = to_string(data)
              parts = re.split(r'-----BEGIN', data)
              if len(parts) == 0:
                  return None
  
              if len(parts[0]) == 0:
                  parts.pop(0)
  
              crt_arr = ['-----BEGIN' + x for x in parts]
              for idx, pem_rec in enumerate(crt_arr):
                  pem_rec = pem_rec.strip()
                  if len(pem_rec) == 0:
                      continue
  
                  if startswith(pem_rec, '-----BEGIN CERTIFICATE REQUEST'):
                      return self.process_pem_csr(pem_rec, name, idx)
                  elif startswith(pem_rec, '-----BEGIN CERTIF'):
                      return self.process_pem_cert(pem_rec, name, idx)
                  elif startswith(pem_rec, '-----BEGIN '):  # fallback
                      return self.process_pem_rsakey(pem_rec, name, idx)
              return ret
  
          except Exception as e:
              logger.debug('Exception processing PEM file %s : %s' % (name, e))
              self.trace_logger.log(e)
          return None
docs: PEM processing - splitting further by the type of the records
          :param data:
          :param name:
          :return: