docs: def private_key_type(key_file):
      """
      Determines type of the private key: RSA, DSA, EC.
  
      :param key_file: file path
      :type key_file: str
      :return: one of "RSA", "DSA" or "EC"
      :except CannotFindKeyTypeError
      """
  
      keytypes = (("RSA", RSA), ("DSA", DSA), ("EC", EC))
  
      for key, ktype in keytypes:
          try:
              ktype.load_key(key_file)
          except (RSA.RSAError, DSA.DSAError, ValueError):
              continue
          else:
              return key
      else:
          raise CannotFindKeyTypeError()