Windows smart card manager

Smart Card Resource Manager

The smart card resource manager manages access to readers and to smart cards. To manage these resources, it performs the following functions.

Identifies and tracks resources.

Allocates readers and resources across multiple applications.

Supports transaction primitives for accessing services available on a given card.

This is an important point because current cards are single-threaded devices that often require the execution of multiple commands to complete a single function. Transactions allow multiple commands to be executed without interruption, ensuring that intermediate state information is not corrupted.

The resource manager can be accessed directly by way of the resource manager API or indirectly through any smart card service provider.

The resource manager API is a set of Windows functions that provide direct access to the resource manager’s services. For an overview of the Windows functions provided by the API, see Smart Card Resource Manager API. In comparison, smart card service providers use COM interfaces.

Many of the Windows functions in the resource manager API have equivalents in the properties and methods of the smart card service providers’ COM interfaces. And although most application developers will find COM easier to work with, some applications will still need to use the Windows functions to perform certain tasks. For example, applications that need to manipulate the list of readers or reader groups in the smart card database, and those that need direct control of a reader, must use the resource manager API. The services that provide these capabilities are available only in the Windows functions, not in the COM provided by the service providers.

For information about how the resource manager is implemented in Windows, see Resource Manager Implementation.

Технический справочник по смарт-карте Smart Card Technical Reference

Применимо к: Windows 10, Windows Server 2016 Applies To: Windows 10, Windows Server 2016

Технический справочник по смарт-картам описывает инфраструктуру смарт-карт Windows для физических смарт-карт и работу компонентов, связанных с смарт-картами, в Windows. The Smart Card Technical Reference describes the Windows smart card infrastructure for physical smart cards and how smart card-related components work in Windows. В этом документе также содержатся сведения о средствах, которые ИТ-разработчики и администраторы могут использовать для устранения неполадок, отладки и развертывания проверки подлинности на основе смарт-карт на предприятии. This document also contains information about tools that information technology (IT) developers and administrators can use to troubleshoot, debug, and deploy smart card-based strong authentication in the enterprise.

Аудитория Audience

В этом документе объясняется, как работает инфраструктура смарт-карт Windows. This document explains how the Windows smart card infrastructure works. Чтобы понять эту информацию, необходимо иметь базовые знания об инфраструктуре открытых ключей (PKI) и понятиях смарт-карт. To understand this information, you should have basic knowledge of public key infrastructure (PKI) and smart card concepts. Этот документ предназначен для: This document is intended for:

Корпоративные ИТ-разработчики, менеджеры и сотрудники, плановые развертывание или использование смарт-карт в организации. Enterprise IT developers, managers, and staff who are planning to deploy or are using smart cards in their organization.

Поставщики смарт-карт, которые записывают мини-диски смарт-карт или поставщики учетных данных. Smart card vendors who write smart card minidrivers or credential providers.

Что такое смарт-карты? What are smart cards?

Смарт-карты — это устойчивые к взлому переносимые устройства хранения, которые могут повысить безопасность таких задач, как проверка подлинности клиентов, подписание кода, защита электронной почты и вход с помощью учетной записи домена Windows. Smart cards are tamper-resistant portable storage devices that can enhance the security of tasks such as authenticating clients, signing code, securing e-mail, and signing in with a Windows domain account.

Смарт-карты предоставляют: Smart cards provide:

Защищенное от взлома хранилище для защиты закрытых ключей и других форм личной информации. Tamper-resistant storage for protecting private keys and other forms of personal information.

Изоляция критически важных для безопасности вычислений, которые включают проверку подлинности, цифровые подписи и обмен ключами с других частей компьютера. Isolation of security-critical computations that involve authentication, digital signatures, and key exchange from other parts of the computer. Эти вычисления выполняются на смарт-карте. These computations are performed on the smart card.

Читайте также:  Не устанавливается стим линукс

Переносимость учетных данных и другой частной информации между компьютерами на работе, дома или в пути. Portability of credentials and other private information between computers at work, home, or on the road.

Смарт-карты можно использовать только для входов в учетные записи домена, а не локальные учетные записи. Smart cards can be used to sign in to domain accounts only, not local accounts. При использовании пароля для интерактивного доступа к учетной записи домена Windows использует для проверки подлинности протокол Kerberos версии 5 (v5). When you use a password to sign in interactively to a domain account, Windows uses the Kerberos version 5 (v5) protocol for authentication. Если вы используете смарт-карту, операционная система использует проверку подлинности Kerberos v5 с сертификатами X.509 v3. If you use a smart card, the operating system uses Kerberos v5 authentication with X.509 v3 certificates.

Виртуальные смарт-карты были представлены в Windows Server 2012 и Windows 8, чтобы снизить потребность в физической смарт-карте, устройстве чтения смарт-карт и связанном администрировании этого оборудования. Virtual smart cards were introduced in Windows Server 2012 and Windows 8 to alleviate the need for a physical smart card, the smart card reader, and the associated administration of that hardware. Сведения о технологии виртуальных смарт-карт см. в обзоре виртуальных смарт-карт. For information about virtual smart card technology, see Virtual Smart Card Overview.

В этом техническом справочнике In this technical reference

Эта справка содержит следующие разделы. This reference contains the following topics.

Устранение неполадок смарт-карт Smart Card Troubleshooting

Применяется к: Windows 10, Windows Server 2016 Applies To: Windows 10, Windows Server 2016

В этой статье рассказывается о средствах и службах, которые разработчики смарт-карт могут использовать для выявления проблем с сертификатами при развертывании смарт-карт. This article explains tools and services that smart card developers can use to help identify certificate issues with the smart card deployment.

Отладка и отслеживание проблем смарт-карт требуют различных средств и подходов. Debugging and tracing smart card issues requires a variety of tools and approaches. В следующих разделах указаны инструменты и подходы, которые можно использовать. The following sections provide guidance about tools and approaches you can use.

Certutil Certutil

Полное описание Certutil, включая примеры, которые показывают, как его использовать, см. в примере Certutil [W2012]. For a complete description of Certutil including examples that show how to use it, see Certutil [W2012].

Сертификаты списка, доступные на смарт-карте List certificates available on the smart card

Чтобы перечислить сертификаты, доступные на смарт-карте, введите certutil -scinfo . To list certificates that are available on the smart card, type certutil -scinfo .

Ввод ПИН-кода не требуется для этой операции. Entering a PIN is not required for this operation. Вы можете нажать ESC, если вам будет предложен ПИН-код. You can press ESC if you are prompted for a PIN.

Удаление сертификатов на смарт-карте Delete certificates on the smart card

Каждый сертификат заключен в контейнер. Each certificate is enclosed in a container. При удалении сертификата на смарт-карте удаляется контейнер для сертификата. When you delete a certificate on the smart card, you’re deleting the container for the certificate.

Чтобы найти значение контейнера, введите certutil -scinfo . To find the container value, type certutil -scinfo .

Чтобы удалить контейнер, введите certutil-delkey-csp «Microsoft Base Smart Card Crypto Provider» To delete a container, type certutil -delkey -csp «Microsoft Base Smart Card Crypto Provider» » «.

Отладка и отслеживание с помощью WPP Debugging and tracing using WPP

WPP упрощает отслеживание работы поставщика трассировки. WPP simplifies tracing the operation of the trace provider. Он предоставляет поставщику трассировки механизм для входа двоичных сообщений в режиме реального времени. It provides a mechanism for the trace provider to log real-time binary messages. Зарегистрированные сообщения можно преобразовать в понятный для человека след операции. Logged messages can be converted to a human-readable trace of the operation. Дополнительные сведения см. в блоге Diagnostics with WPP — блог NDIS. For more information, see Diagnostics with WPP — The NDIS blog.

Включить трассировка Enable the trace

С помощью WPP используйте одну из следующих команд, чтобы включить отслеживание: Using WPP, use one of the following commands to enable tracing:

tracelog.exe -kd-rt-start -guid # -f .\ .etl-flags -ft 1 tracelog.exe -kd -rt -start -guid # -f .\ .etl -flags -ft 1

Начало журнала -ets-p <> — -ft 1 -rt -o .\ **.etl-mode 0x00080000 ** logman start -ets -p <> — -ft 1 -rt -o .\ .etl -mode 0x00080000

Параметры можно использовать в следующей таблице. You can use the parameters in the following table.

Понятное имя Friendly name Код GUID GUID Флажки Flags
scardsvr 13038e47-ffec-425d-bc69-5707708075fe 13038e47-ffec-425d-bc69-5707708075fe 0xffff 0xffff
winscard 3fce7c5f-fb3b-4bce-a9d8-55cc0ce1cf01 3fce7c5f-fb3b-4bce-a9d8-55cc0ce1cf01 0xffff 0xffff
basecsp 133a980d-035d-4e2d-b250-94577ad8fced 133a980d-035d-4e2d-b250-94577ad8fced 0x7 0x7
scksp 133a980d-035d-4e2d-b250-94577ad8fced 133a980d-035d-4e2d-b250-94577ad8fced 0x7 0x7
msclmd fb36caf4-582b-4604-8841-9263574c4f2c fb36caf4-582b-4604-8841-9263574c4f2c 0x7 0x7
credprov dba0e0e0-505a-4ab6-aa3f-22f6f743b480 dba0e0e0-505a-4ab6-aa3f-22f6f743b480 0xffff 0xffff
certprop 30eae751-411f-414c-988b-a8bfa8913f49 30eae751-411f-414c-988b-a8bfa8913f49 0xffff 0xffff
scfilter eed7f3c9-62ba-400e-a001-658869df9a91 eed7f3c9-62ba-400e-a001-658869df9a91 0xffff 0xffff
wudfusbccid a3c09ba3-2f62-4be5-a50f-8278a646ac9d a3c09ba3-2f62-4be5-a50f-8278a646ac9d 0xffff 0xffff

Чтобы включить трассировку для службы SCardSvr: To enable tracing for the SCardSvr service:

tracelog.exe -kd-rt-start scardsvr -guid #13038e47-ffec-425d-bc69-5707708075fe-f .\scardsvr.etl-flags 0xffff -ft 1 tracelog.exe -kd -rt -start scardsvr -guid #13038e47-ffec-425d-bc69-5707708075fe -f .\scardsvr.etl -flags 0xffff -ft 1

logman start scardsvr -ets-p <13038e47-ffec-425d-bc69-5707708075fe>0xffff -ft 1 -rt -o .\scardsvr.etl-mode 0x00080000 logman start scardsvr -ets -p <13038e47-ffec-425d-bc69-5707708075fe>0xffff -ft 1 -rt -o .\scardsvr.etl -mode 0x00080000

Чтобы включить трассировку для scfilter.sys: To enable tracing for scfilter.sys:

  • tracelog.exe-kd-rt-start scfilter-guid #eed7f3c9-62ba-400e-a001-658869df9a91 -f .\scfilter.etl-flags 0xffff-ft 1 tracelog.exe -kd -rt -start scfilter -guid #eed7f3c9-62ba-400e-a001-658869df9a91 -f .\scfilter.etl -flags 0xffff -ft 1

Остановка трассировки Stop the trace

С помощью WPP используйте одну из следующих команд, чтобы остановить трассировку: Using WPP, use one of the following commands to stop the tracing:

tracelog.exe -stop tracelog.exe -stop

logman -stop -ets logman -stop -ets

Примеры: Examples

Чтобы остановить след: To stop a trace:

tracelog.exe -stop scardsvr tracelog.exe -stop scardsvr

logman -stop scardsvr -ets logman -stop scardsvr -ets

Протокол Kerberos, KDC и отладка и отслеживание NTLM Kerberos protocol, KDC, and NTLM debugging and tracing

Эти ресурсы можно использовать для устранения неполадок этих протоколов и KDC: You can use these resources to troubleshoot these protocols and the KDC:

Набор драйверов Windows (WDK) и средства отладки для Windows (WinDbg). Windows Driver Kit (WDK) and Debugging Tools for Windows (WinDbg). Вы можете использовать средство журнала трассировки в этом SDK для отладки сбоев проверки подлинности Kerberos. You can use the trace log tool in this SDK to debug Kerberos authentication failures.

Чтобы начать трассировку, можно использовать Tracelog . To begin tracing, you can use Tracelog . Различные компоненты используют различные GUID-интерфейсы управления, как это объясняется в этих примерах. Different components use different control GUIDs as explained in these examples. Дополнительные сведения Tracelog см. в . For more information, see Tracelog .

Протокол NTLM NTLM

Чтобы включить трассировку для проверки подлинности NTLM, запустите следующую команду в командной строке: To enable tracing for NTLM authentication, run the following command on the command line:

  • tracelog.exe-kd-rt-start ntlm -guid #5BBB6C18-AA45-49b1-A15F-085F7ED0AA90 -f .\ntlm.etl-flags 0x15003-ft 1 tracelog.exe -kd -rt -start ntlm -guid #5BBB6C18-AA45-49b1-A15F-085F7ED0AA90 -f .\ntlm.etl -flags 0x15003 -ft 1

Чтобы остановить отслеживание для проверки подлинности NTLM, запустите эту команду: To stop tracing for NTLM authentication, run this command:

  • tracelog -stop ntlm tracelog -stop ntlm

Проверка подлинности Kerberos Kerberos authentication

Чтобы включить трассировку для проверки подлинности Kerberos, запустите эту команду: To enable tracing for Kerberos authentication, run this command:

  • tracelog.exe-kd-rt-start kerb-guid #6B510852-3583-4e2d-AFFE-A67F9F223438 -f .\kerb.etl-flags 0x43-ft 1 tracelog.exe -kd -rt -start kerb -guid #6B510852-3583-4e2d-AFFE-A67F9F223438 -f .\kerb.etl -flags 0x43 -ft 1

Чтобы остановить отслеживание проверки подлинности Kerberos, запустите эту команду: To stop tracing for Kerberos authentication, run this command:

  • tracelog.exe -stop kerb tracelog.exe -stop kerb

KDC KDC

Чтобы включить трассировку для KDC, запустите следующую команду в командной строке: To enable tracing for the KDC, run the following command on the command line:

  • tracelog.exe-kd-rt-start kdc-guid #1BBA8B19-7F31-43c0-9643-6E911F79A06B -f .\kdc.etl-flags 0x803-ft 1 tracelog.exe -kd -rt -start kdc -guid #1BBA8B19-7F31-43c0-9643-6E911F79A06B -f .\kdc.etl -flags 0x803 -ft 1

Чтобы остановить отслеживание для KDC, запустите следующую команду в командной строке: To stop tracing for the KDC, run the following command on the command line:

  • tracelog.exe -stop kdc tracelog.exe -stop kdc

Чтобы остановить отслеживание с удаленного компьютера, запустите эту команду: logman.exe -s * *. To stop tracing from a remote computer, run this command: logman.exe -s .

Расположение по умолчанию для logman.exe % systemroot%system32\. The default location for logman.exe is %systemroot%system32\. Используйте параметр -s для поставки имени компьютера. Use the -s option to supply a computer name.

Настройка отслеживания с помощью реестра Configure tracing with the registry

Вы также можете настроить трассировку, редактировать значения реестра Kerberos, показанные в следующей таблице. You can also configure tracing by editing the Kerberos registry values shown in the following table.

Элемент Element Параметр ключа реестра Registry Key Setting
Протокол NTLM NTLM HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
Имя значения: NtLmInfoLevel Value name: NtLmInfoLevel
Тип значения: DWORD Value type: DWORD
Данные значения: c0015003 Value data: c0015003
Kerberos Kerberos HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos
Имя значения: LogToFile Value name: LogToFile
Тип значения: DWORD Value type: DWORD
Данные значения: 00000001 Value data: 00000001

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters
Имя значения: KerbDebugLevel Value name: KerbDebugLevel
Тип значения: DWORD Value type: DWORD
Данные значения: c0000043 Value data: c0000043

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters
Имя значения: LogToFile Value name: LogToFile
Тип значения: DWORD Value type: DWORD
Данные значения: 00000001 Value data: 00000001

KDC KDC HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kdc HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Kdc
Имя значения: KdcDebugLevel Value name: KdcDebugLevel
Тип значения: DWORD Value type: DWORD
Данные значения: c0000803 Value data: c0000803

Если вы использовали, посмотрите следующий файл журнала в текущем Tracelog каталоге: kerb.etl/kdc.etl/ntlm.etl. If you used Tracelog , look for the following log file in your current directory: kerb.etl/kdc.etl/ntlm.etl.

Если вы использовали параметры ключей реестра, показанные в предыдущей таблице, посмотрите на файлы журнала трассировки в следующих расположениях: If you used the registry key settings shown in the previous table, look for the trace log files in the following locations:

NTLM: %systemroot%\tracing\msv1_0 NTLM: %systemroot%\tracing\msv1_0

Kerberos: %systemroot%\tracing\kerberos Kerberos: %systemroot%\tracing\kerberos

KDC: %systemroot%\tracing\kdcsvc KDC: %systemroot%\tracing\kdcsvc

Для расшифровки файлов трассировки событий можно использовать Tracefmt (tracefmt.exe). To decode event trace files, you can use Tracefmt (tracefmt.exe). Tracefmt — это средство командной строки, которое форматы и отображение сообщений трассировки из файла журнала трассировки событий (.etl) или сеанса трассировки в режиме реального времени. is a command-line tool that formats and displays trace messages from an event trace log file (.etl) or a real-time trace session. Tracefmt может отображать сообщения в окне Командная подсказка или сохранять их в текстовом файле. can display the messages in the Command Prompt window or save them in a text file. Он расположен в поднаправлении \tools\tracing набора драйверов Windows (WDK). It is located in the \tools\tracing subdirectory of the Windows Driver Kit (WDK). Дополнительные сведения Tracefmt см. в . For more information, see Tracefmt .

Служба смарт-карт Smart Card service

Служба диспетчера ресурсов смарт-карт работает в контексте локальной службы. The smart card resource manager service runs in the context of a local service. Он реализуется в качестве общей службы процесса хост-службы (svchost). It’s implemented as a shared service of the services host (svchost) process.

Чтобы проверить, запущена ли служба Смарт-карты To check if Smart Card service is running

Нажмите кнопку CTRL+ALT+DEL, а затем выберите start Task Manager. Press CTRL+ALT+DEL, and then select Start Task Manager.

В диалоговом окне Диспетчер задач Windows выберите вкладку Services. In the Windows Task Manager dialog box, select the Services tab.

Выберите столбец Name для сортировки списка в алфавитном порядке, а затем введите s. Select the Name column to sort the list alphabetically, and then type s.

В столбце Имя посмотрите на SCardSvr, а затем посмотрите в столбце Состояние, чтобы узнать, запущена или остановлена служба. In the Name column, look for SCardSvr, and then look under the Status column to see if the service is running or stopped.

Перезапуск службы смарт-карт To restart Smart Card service

Запустите в качестве администратора в командной подсказке. Run as administrator at the command prompt.

Если появится диалоговое окно «Управление учетной записью пользователя», подтвердите, что отображаемая в нем акция является нужным, а затем выберите Да. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then select Yes.

В командной подсказке введите net stop SCardSvr . At the command prompt, type net stop SCardSvr .

В командной подсказке введите net start SCardSvr . At the command prompt, type net start SCardSvr .

Вы можете использовать следующую команду в командной подсказке, чтобы проверить, запущена ли служба: sc queryex scardsvr . You can use the following command at the command prompt to check whether the service is running: sc queryex scardsvr .

В следующем примере кода приводится пример вывода из этой команды: The following code sample is an example output from this command:

Считыватели смарт-карт Smart card readers

Как и любое устройство, подключенное к компьютеру, диспетчер устройств можно использовать для просмотра свойств и начала процесса отлаговки. As with any device connected to a computer, Device Manager can be used to view properties and begin the debug process.

Чтобы проверить, работает ли считыватель смарт-карт To check if smart card reader is working

Перейдите к компьютеру. Navigate to Computer.

Щелкните правой кнопкой мыши Компьютер, а затем выберите Свойства. Right-click Computer, and then select Properties.

В статье Задачивыберите диспетчер устройств. Under Tasks, select Device Manager.

В диспетчере устройств раздайте считывателисмарт-карт, выберите имя считывателей смарт-карт, которые необходимо проверить, а затем выберите Свойства. In Device Manager, expand Smart card readers, select the name of the smart card reader you want to check, and then select Properties.

Если считыватель смарт-карт не указан в диспетчере устройств, в меню Action выберите scan для изменения оборудования. If the smart card reader is not listed in Device Manager, in the Action menu, select Scan for hardware changes.

Диагностика CryptoAPI 2.0 CryptoAPI 2.0 Diagnostics

Диагностика CryptoAPI 2.0 доступна в версиях Windows, которые поддерживают CryptoAPI 2.0 и могут помочь устранить проблемы с инфраструктурой ключевых общедоступных ключевых элементов (PKI). CryptoAPI 2.0 Diagnostics is available in Windows versions that support CryptoAPI 2.0 and can help you troubleshoot public key infrastructure (PKI) issues.

CryptoAPI 2.0 Журналы диагностики событий в журнале событий Windows. CryptoAPI 2.0 Diagnostics logs events in the Windows event log. Журналы содержат подробные сведения о проверке цепочки сертификатов, операциях хранения сертификатов и проверке подписи. The logs contain detailed information about certificate chain validation, certificate store operations, and signature verification. Эта информация упрощает определение причин проблем и сокращает время, необходимое для диагностики. This information makes it easier to identify the causes of issues and reduces the time required for diagnosis.

Дополнительные сведения о диагностике CryptoAPI 2.0 см. в статью Устранение неполадок корпоративного PKI. For more information about CryptoAPI 2.0 Diagnostics, see Troubleshooting an Enterprise PKI.

Оцените статью