Windows KSP und PKCS#11 mit 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.
Mögliche Anwendungsfälle für diese Einrichtung sind:
Code signing
Document signing
Tipp
Weitere Informationen finden Sie auch in der offiziellen Dokumentation PKI Proxy.
Voraussetzungen¶
HSM 2
Initialized
Provisioned with keys and certificates
Windows machine
OpenSC PKCS#11 driver installed (only required on the PKI Proxy Server).
PKI-Vollmacht - Server¶
The PKI Proxy server shares the keys and certificates from a HSM 2 for different users.
Installation¶
Download the PKI Proxy 2024 installer from the /n software website.
Öffnen Sie das Installationsprogramm und folgen Sie den Anweisungen des Installationsassistenten.
Öffnen Sie PKI Proxy über das Startmenü. Wenn Sie ihn am Standardspeicherort installiert haben, können Sie ihn auch mit dem folgenden Befehl aus dem Dialog Run oder der PowerShell ausführen.
C:\Program Files\PKI Proxy 2024\PKIProxy.exeBemerkung
PKI Proxy wird in die Taskleiste minimiert, auch wenn das Hauptfenster geschlossen ist.
Service Configuration¶
Die folgenden Anweisungen konfigurieren den PKI-Proxy.
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.
Erstellen Sie einen neuen Benutzer, indem Sie auf die Schaltfläche New… klicken. Wählen Sie eine Authentifizierungsart, die von allen Clients unterstützt wird.
Klicken Sie in der Menüleiste des Hauptfensters auf die Schaltfläche Start, um den PKI-Proxy-Dienst zu starten.
Publish Certificates from the HSM 2¶
In the following we configure which certificates from the HSM 2 are made available through PKI Proxy.
Stellen Sie sicher, dass das Hauptfenster von PKI Proxy geöffnet ist.
Change to the Certificates tab.
Klicken Sie auf die Schaltfläche Neu…. Daraufhin wird das Fenster Aktienzertifikat geöffnet.
Klicken Sie auf die Schaltfläche Zertifikat oder Schlüssel auswählen… im Rahmen Zertifikat des Fensters. Daraufhin wird das Fenster Privaten Schlüssel auswählen geöffnet.
Wechseln Sie zur Registerkarte Sicherheitsschlüssel.
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.
Geben Sie im Textfeld „ -PIN“ die PIN für Ihr HSM 2 ein.
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.
Klicken Sie auf die Schaltfläche OK, um die Auswahl zu bestätigen. Dadurch gelangen Sie zurück zum Fenster Aktienzertifikat. Im Fenster werden nun die Details des ausgewählten Zertifikats angezeigt.
Klicken Sie auf die Schaltfläche Hinzufügen… im Rahmen Zugriff und Berechtigungen des Fensters. Daraufhin wird das Fenster Benutzer auswählen geöffnet.
Wählen Sie einen vorhandenen Benutzer aus dem Dropdown-Menü oder erstellen Sie einen neuen, indem Sie Neuen Benutzer erstellen… wählen. Klicken Sie auf die Schaltfläche OK, um Ihre Auswahl zu bestätigen. Wenn Sie sich für die Erstellung eines neuen Benutzers entscheiden, wird anschließend das Fenster Neuer Benutzer angezeigt.
Stellen Sie auch im Fenster Share Certificate sicher, dass nur die erforderlichen Operationen für das Zertifikat oder den generischen Schlüssel erlaubt sind. Dies kann mit den Kontrollkästchen am unteren Rand des Rahmens Zugriff und Berechtigungen geändert werden.
Klicken Sie auf die Schaltfläche OK, um das Zertifikat zu veröffentlichen. Damit kehren Sie zum Hauptfenster von PKI Proxy zurück.
Die Textliste unter Certificate Management zeigt nun das veröffentlichte Zertifikat an.
PKI-Vollmacht - Kunde¶
Die PKI Proxy-Client-Tools bieten verschiedene Möglichkeiten für den Zugriff auf die gemeinsamen Schlüssel und Zertifikate eines PKI Proxy-Servers.
Tipp
Der PKI-Proxy-Server enthält die Client-Tools. Daher kann der Rechner, auf dem der Server läuft, auch selbst ein Client sein.
Installation¶
Laden Sie die PKI Proxy 2024 - Client Tools von der /n software website herunter.
Öffnen Sie das Installationsprogramm und folgen Sie den Anweisungen des Installationsassistenten.
KSP (Key Storage Provider)¶
PKI Proxy bietet eine KSP für die Schnittstelle zum PKI Proxy-Server. Der KSP ermöglicht die Verwendung von nativen Windows-APIs mit Anwendungen über die CNG-Schnittstelle (Cryptography API: Next Generation). Weitere Informationen finden Sie in der Dokumentation PKI Proxy.
PKCS#11¶
PKI Proxy bietet ein PKCS#11-Modul für die Schnittstelle zum PKI Proxy-Server. Weitere Informationen finden Sie in der Dokumentation PKI Proxy.