def _get_smartcard_keychain(xml):
  """Get keychain items from the output of 'system_profiler SPSmartCardsDataType -xml'"""
  keychain = [x for x in xml if x.get("_name", None) == "AVAIL_SMARTCARDS_KEYCHAIN"]

  if len(keychain) == 0:
    return []

  keychain = keychain[0].get("_items", None)
  return keychain