Windows KSP et PKCS#11 avec 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.
Les cas d’utilisation possibles de cette configuration sont les suivants :
Code signing
Document signing
Astuce
Veuillez également vous référer à la documentation officielle PKI Proxy pour plus d’informations.
Conditions préalables¶
HSM 2
Initialized
Provisioned with keys and certificates
Windows machine
OpenSC PKCS#11 driver installed (only required on the PKI Proxy Server).
Proxy PKI - Serveur¶
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.
Ouvrez le programme d’installation et suivez l’assistant d’installation.
Ouvrez PKI Proxy dans le menu Démarrer. Si vous l’avez installé à l’emplacement par défaut, vous pouvez également l’exécuter à l’aide de la commande suivante dans la boîte de dialogue Run ou dans PowerShell.
C:\Program Files\PKI Proxy 2024\PKIProxy.exeNote
PKI Proxy sera minimisé dans la barre d’état système, même si la fenêtre principale est fermée.
Service Configuration¶
Les instructions ci-dessous permettent de configurer le 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.
Créez un nouvel utilisateur en cliquant sur le bouton New…. Choisissez un type d’authentification supporté par tous les clients.
Dans la barre de menu de la fenêtre principale, cliquez sur le bouton Start pour démarrer le service 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.
Assurez-vous que la fenêtre principale de PKI Proxy est ouverte.
Change to the Certificates tab.
Cliquez sur le bouton New…. La fenêtre Share Certificate s’ouvre.
Cliquez sur le bouton Select Certificate or Key…, dans le cadre Certificate de la fenêtre. La fenêtre Select a Private Key s’ouvre alors.
Passez à l’onglet 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.
Dans le champ « PIN », saisissez le code PIN de votre 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.
Cliquez sur le bouton OK pour confirmer la sélection. Vous revenez alors à la fenêtre Share Certificate. La fenêtre affiche maintenant les détails du certificat sélectionné.
Cliquez sur le bouton Add…, dans le cadre Access and Permissions de la fenêtre. La fenêtre Select user s’ouvre.
Sélectionnez un utilisateur existant dans le menu déroulant ou créez-en un nouveau en choisissant Create New User…. Cliquez sur le bouton OK pour confirmer la sélection. Si vous choisissez de créer un nouvel utilisateur, la fenêtre New User s’affichera ensuite.
De retour dans la fenêtre Share Certificate, assurez-vous également de n’autoriser que les opérations requises pour le certificat ou la clé générique. Cela peut être modifié à l’aide des cases à cocher situées en bas du cadre Access and Permissions.
Cliquez sur le bouton OK pour publier le certificat. Vous revenez alors à la fenêtre principale de PKI Proxy.
La liste de texte sous Certificate Management affiche maintenant le certificat publié.
Proxy PKI - Client¶
Les outils clients PKI Proxy offrent différentes manières d’accéder aux clés partagées et aux certificats d’un serveur PKI Proxy.
Astuce
Le serveur proxy PKI contient les outils du client. Par conséquent, la machine qui exécute le serveur peut également être un client pour lui-même.
Installation¶
Téléchargez le logiciel PKI Proxy 2024 - Client Tools à partir du site web /n software.
Ouvrez le programme d’installation et suivez l’assistant d’installation.
KSP (Key Storage Provider)¶
PKI Proxy fournit un KSP pour l’interface avec le serveur PKI Proxy. Le KSP permet d’utiliser les API Windows natives avec les applications, par le biais de l’interface CNG (Cryptography API : Next Generation). Pour plus d’informations, veuillez consulter la documentation de PKI Proxy.
PKCS#11¶
PKI Proxy fournit un module PKCS#11 pour l’interface avec le serveur PKI Proxy. Pour plus d’informations, veuillez consulter la documentation PKI Proxy.