Windows KSP i PKCS#11 z PKI Proxy¶
This document explains the usage of PKI Proxy with HSM 2. PKI Proxy enables the usage of HSM 2 through the native Microsoft Windows APIs. For this purpose, PKI Proxy includes a KSP (Key Storage Provider) that enables its use via the CNG (Cryptography API: Next Generation) interface. Additionally it provides PKCS#11 access to the HSM 2, but this should only be used if your setup requires it for example if you need the additional authentication features of PKI Proxy, or if you need to access it from a remote machine running an application that only supports PKCS#11. In all other cases use the PKCS#11 driver from the OpenSC project directly.
The deployment of HSM 2 with PKI Proxy looks like this.
The HSM 2 is connected via its USB interface to the PKI Proxy server. PKI Proxy uses the OpenSC PKCS#11 driver to connect to the HSM 2 and access its keys and certificates. Clients to the PKI Proxy use the REST API of the PKI Proxy server to access the keys and certificates. Applications on the client can either use the native Windows API or a PKCS#11 driver. PKI Proxy server and client can be executed on the same computer.
Możliwe przypadki użycia tej konfiguracji są następujące:
Code signing
Document signing
Wskazówka
Więcej informacji można znaleźć w oficjalnej dokumentacji PKI Proxy.
Wymagania wstępne¶
HSM 2
Initialized
Provisioned with keys and certificates
Windows machine
OpenSC PKCS#11 driver installed (only required on the PKI Proxy Server).
Serwer proxy PKI¶
The PKI Proxy server shares the keys and certificates from a HSM 2 for different users.
Instalacja¶
Download the PKI Proxy 2024 installer from the /n software website.
Otwórz instalator i postępuj zgodnie z instrukcjami kreatora instalacji.
Otwórz PKI Proxy z menu Start. Jeśli zainstalowałeś go w domyślnej lokalizacji, możesz również uruchomić go za pomocą następującego polecenia z okna dialogowego Uruchom lub PowerShell.
C:\Program Files\PKI Proxy 2024\PKIProxy.exeInformacja
PKI Proxy zminimalizuje się do zasobnika systemowego, nawet jeśli główne okno zostanie zamknięte.
Service Configuration¶
Poniższe instrukcje konfigurują serwer proxy PKI.
Open the PKI Proxy main window.
Change to the Settings tab.
Make sure the checkbox Enable TLS is checked and an appropriate certificate is used.
Change to the Users tab.
Utwórz nowego użytkownika, klikając przycisk New…. Wybierz typ uwierzytelniania obsługiwany przez wszystkich klientów.
Na pasku menu okna głównego kliknij przycisk Start, aby uruchomić usługę PKI Proxy.
Publish Certificates from the HSM 2¶
In the following we configure which certificates from the HSM 2 are made available through PKI Proxy.
Upewnij się, że główne okno PKI Proxy jest otwarte.
Change to the Certificates tab.
Kliknij przycisk New…. Spowoduje to otwarcie okna Share Certificate.
Kliknij przycisk Select Certificate or Key… w ramce Certificate okna. Spowoduje to otwarcie okna Select a Private Key.
Przejdź do karty Security Key.
Click the Browse… button and select the OpenSC PKCS#11 driver library file. The text field PKCS#11 Library now shows the path to the library file.
From the dropdown menu Security Key (PKCS#11) choose the slot which contains the certificate. The listed slots depend on your configuration of the HSM 2.
W polu tekstowym „ ” (PIN) wprowadź kod PIN swojego modułu HSM 2.
Click the Open button.
The text list below Certificates now shows a list of the available certificates and generic keys on the HSM 2. Select the certificate or generic key you want to share with PKI Proxy.
Kliknij przycisk OK, aby potwierdzić wybór. Spowoduje to powrót do okna Share Certificate. Okno wyświetli teraz szczegóły wybranego certyfikatu.
Kliknij przycisk Add… w ramce Access and Permissions okna. Spowoduje to otwarcie okna Select user.
Wybierz istniejącego użytkownika z rozwijanego menu lub utwórz nowego, wybierając Create New User…. Kliknij przycisk OK, aby potwierdzić wybór. W przypadku wybrania opcji utworzenia nowego użytkownika zostanie wyświetlone okno New User.
Z powrotem w oknie Udostępnij certyfikat upewnij się również, że zezwalasz tylko na wymagane operacje dla certyfikatu lub klucza ogólnego. Można to zmienić za pomocą pól wyboru w dolnej części ramki Access and Permissions.
Kliknij przycisk OK, aby opublikować certyfikat. Spowoduje to powrót do głównego okna PKI Proxy.
Lista tekstowa poniżej Certificate Management pokazuje teraz opublikowany certyfikat.
PKI Proxy - Klient¶
Narzędzia klienckie PKI Proxy zapewniają różne sposoby dostępu do współdzielonych kluczy i certyfikatów z serwera PKI Proxy.
Wskazówka
Serwer PKI Proxy zawiera narzędzia klienckie. Dlatego maszyna, na której działa serwer, może być również klientem dla siebie.
Instalacja¶
Pobierz PKI Proxy 2024 - Client Tools ze strony internetowej /n software.
Otwórz instalator i postępuj zgodnie z instrukcjami kreatora instalacji.
KSP (Key Storage Provider)¶
PKI Proxy zapewnia KSP do połączenia z serwerem PKI Proxy. KSP umożliwia korzystanie z natywnych interfejsów API systemu Windows z aplikacjami za pośrednictwem interfejsu CNG (Cryptography API: Next Generation). Więcej informacji można znaleźć w dokumentacji PKI Proxy.
PKCS#11¶
PKI Proxy zapewnia moduł PKCS#11 do połączenia z serwerem PKI Proxy. Więcej informacji można znaleźć w dokumentacji PKI Proxy.