
Mac 上的進階智慧卡選項
智慧卡配置設定
你可以使用命令列執行下列選項來在 Mac 電腦上檢視和編輯特定的智慧卡設定和記錄:
列出系統中的可用代號。
pluginkit -m -p com.apple.ctk-tokens
com.apple.CryptoTokenKit.setoken(1.0)
com.apple.CryptoTokenKit.pivtoken(1.0)
啟用、停用或列出已停用的智慧卡代號。
sudo security smartcards token [-l] [-e token] [-d token]
取消配對智慧卡。
sudo sc_auth unpair -u jappleeed
顯示可用的智慧卡。
sudo security list-smartcards
從智慧卡輸出項目。
sudo security export-smartcard
智慧卡記錄。
sudo defaults write /Library/Preferences/com.apple.security.smartcard Logging -bool true
停用內建 PIV 代號。
sudo defaults write /Library/Preferences/com.apple.security.smartcard DisabledTokens -array com.apple.CryptoTokenKit.pivtoken
除了使用命令列,下列選項也可使用「智慧卡」承載資料管理。如需更多資訊,請參閱:「智慧卡」MDM 承載資料設定。
插入代號時隱藏配對提示。
sudo defaults write /Library/Preferences/com.apple.security.smartcard UserPairing -bool false
限制使用者帳號配對至單一智慧卡。
sudo defaults write /Library/Preferences/com.apple.security.smartcard oneCardPerUser -bool true
停用登入和授權的智慧卡使用者。
sudo defaults write /Library/Preferences/com.apple.security.smartcard allowSmartCard -bool false
【注意】停用 allowSmartCard 時,智慧卡憑證識別身分仍可用於其他操作(例如簽署和加密)以及支援的第三方 App 中。
管理智慧卡憑證信任行為。
sudo defaults write /Library/Preferences/com.apple.security.smartcard checkCertificateTrust -int <value>
值可為下列其中一個:
0:不需要智慧卡憑證信任。
1:智慧卡憑證和鏈必須受信任。
2:憑證和鏈必須受信任,且不可以收到遭撤銷的狀態。
3:憑證和鏈必須受信任,且回傳的撤銷狀態為有效。
憑證關聯
可指定用於智慧卡憑證信任評估的憑證核發管理中心。這個可搭配「憑證信任」設定(需為 1、2 或 3)使用的信任稱為憑證關聯。將憑證授權管理中心的 SHA-256 指紋放入 TrustedAuthorities
陣列中(以字串值形式,以逗號分隔且不含空格)。請參考下方的範例檔案 /private/etc/SmartcardLogin.plist。使用憑證關聯時,只有此清單中的憑證授權管理中心所核發的智慧卡憑證會評估為受信任。請注意,當 checkCertificateTrust
設定設為 0(關閉)時,系統會忽略 TrustedAuthorities
陣列。編輯後請確認擁有權為「根」權限,且權限設為「公開讀取」。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AttributeMapping</key>
<dict>
<key>dsAttributeString</key>
<string>dsAttrTypeStandard:AltSecurityIdentities</string>
<key>fields</key>
<array>
<string>NT Principal Name</string>
</array>
<key>formatString</key>
<string>Kerberos:$1</string>
</dict>
<key>TrustedAuthorities</key>
<array>
<string>SHA256_HASH_OF_CERTDOMAIN_1,SHA256_HASH_OF_CERTDOMAIN_2</string>
</array>
</dict>
</plist>