code: def _self_signed(cert):
      
  
      self_signed = cert.self_signed
  
      if self_signed == 'yes':
          return True
      if self_signed == 'no':
          return False
  
      # In the case of "maybe", we have to check the signature
      signature_algo = cert['signature_algorithm'].signature_algo
      hash_algo = cert['signature_algorithm'].hash_algo
  
      if signature_algo == 'rsassa_pkcs1v15':
          verify_func = asymmetric.rsa_pkcs1v15_verify
      elif signature_algo == 'dsa':
          verify_func = asymmetric.dsa_verify
      elif signature_algo == 'ecdsa':
          verify_func = asymmetric.ecdsa_verify
      else:
          raise PathValidationError(pretty_message(
              '''
              Unable to verify the signature of the certificate since it uses
              the unsupported algorithm %s
              ''',
              signature_algo
          ))
  
      try:
          key_object = asymmetric.load_certificate(cert)
          verify_func(key_object, cert['signature_value'].native, cert['tbs_certificate'].dump(), hash_algo)
          return True
  
      except (oscrypto.errors.SignatureError):
          return False
docs: Determines if a certificate is self-signed
  
      :param cert:
          An asn1crypto.x509.Certificate object to check
  
      :return:
          A boolean - True if the certificate is self-signed, False otherwise