code: def der_cert(der_data):
      
      if isinstance(der_data, str):
          der_data = bytes(der_data, 'utf-8')
      return x509.load_der_x509_certificate(der_data, default_backend())
docs: Load a DER encoded certificate
  
      :param der_data: DER-encoded certificate
      :return: A cryptography.x509.certificate instance