(sudo_password=None)
Deletes existing TLS identity preferences.

  There's no way to list all identity preferences without knowing the full name
  so it's necessary to dump all keychains and search for the desired
  preferences.  All of the desired preferences have a line in the output like
  the following:

      "svce"<blob>="com.apple.network.eap.user.identity.wlan.ssid.<SSID>"

      or

      "svce"<blob>="com.apple.network.eap.system.identity.profileid.B7392191"

  Args:
    sudo_password: str, optional, for removing from system keychain
Deletes existing TLS identity preferences.
Deletes existing TLS identity preferences .
def ClearIdentityPreferences(sudo_password=None):
  """Deletes existing TLS identity preferences.

  There's no way to list all identity preferences without knowing the full name
  so it's necessary to dump all keychains and search for the desired
  preferences.  All of the desired preferences have a line in the output like
  the following:

      "svce"<blob>="com.apple.network.eap.user.identity.wlan.ssid.<SSID>"

      or

      "svce"<blob>="com.apple.network.eap.system.identity.profileid.B7392191"

  Args:
    sudo_password: str, optional, for removing from system keychain
  """
  service_re = re.compile(r'\s*"svce"<blob>="(com\.apple\.network\.eap\..*)"')

  cmd = [CMD_SECURITY, 'dump-keychain']
  (keychain_content, _, _) = gmacpyutil.RunProcess(cmd)

  for line in keychain_content.splitlines():
    matches = service_re.match(line)
    if matches:
      cmd = [CMD_SECURITY, 'set-identity-preference',
             '-n', '-s', matches.group(1)]
      logging.debug('Removing identity preference: %s', cmd)
      gmacpyutil.RunProcess(cmd, sudo=bool(sudo_password),
                            sudo_password=sudo_password)
def ClearIdentityPreferences ( sudo_password = None ) : service_re = re . compile ( r'\s*"svce"<blob>="(com\.apple\.network\.eap\..*)"' ) cmd = [ CMD_SECURITY , 'dump-keychain' ] ( keychain_content , _ , _ ) = gmacpyutil . RunProcess ( cmd ) for line in keychain_content . splitlines ( ) : matches = service_re . match ( line ) if matches : cmd = [ CMD_SECURITY , 'set-identity-preference' , '-n' , '-s' , matches . group ( 1 ) ] logging . debug ( 'Removing identity preference: %s' , cmd ) gmacpyutil . RunProcess ( cmd , sudo = bool ( sudo_password ) , sudo_password = sudo_password )