Windows KSP e PKCS#11 con 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.
I possibili casi d’uso di questa configurazione sono:
Code signing
Document signing
Suggerimento
Per ulteriori informazioni, consultare la documentazione ufficiale di PKI Proxy.
Prerequisiti¶
HSM 2
Initialized
Provisioned with keys and certificates
Windows machine
OpenSC PKCS#11 driver installed (only required on the PKI Proxy Server).
Proxy PKI - Server¶
The PKI Proxy server shares the keys and certificates from a HSM 2 for different users.
Installazione¶
Download the PKI Proxy 2024 installer from the /n software website.
Aprire il programma di installazione e seguire la procedura guidata.
Aprire PKI Proxy dal menu Start. Se è stato installato nella posizione predefinita, è anche possibile eseguirlo con il seguente comando dalla finestra di dialogo Run o da PowerShell.
C:\Program Files\PKI Proxy 2024\PKIProxy.exeNota
PKI Proxy si riduce a icona nella barra delle applicazioni, anche se la finestra principale è chiusa.
Service Configuration¶
Le istruzioni seguenti configurano il 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.
Creare un nuovo utente facendo clic sul pulsante New…. Scegliere un tipo di autenticazione supportato da tutti i client.
Nella barra dei menu della finestra principale, fare clic sul pulsante Start per avviare il servizio 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.
Assicurarsi che la finestra principale di PKI Proxy sia aperta.
Change to the Certificates tab.
Fare clic sul pulsante Nuovo…. Si aprirà la finestra Share Certificate.
Fare clic sul pulsante Select Certificate or Key…, nel riquadro Certificate della finestra. Si aprirà la finestra Seleziona una chiave privata.
Passare alla scheda 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.
Nel campo di testo “ PIN ”, inserisci il PIN del tuo 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.
Fare clic sul pulsante OK per confermare la selezione. In questo modo si tornerà alla finestra Certificato azionario. La finestra mostrerà ora i dettagli del certificato selezionato.
Fate clic sul pulsante Add…, nel riquadro Access and Permissions della finestra. Si aprirà la finestra Selezionare l’utente.
Selezionate un utente esistente dal menu a discesa, oppure createne uno nuovo scegliendo Create New User…. Fare clic sul pulsante OK per confermare la selezione. Se si sceglie di creare un nuovo utente, verrà visualizzata la finestra New User.
Nella finestra Share Certificate assicurarsi di consentire solo le operazioni richieste per il certificato o la chiave generica. Questo può essere modificato con le caselle di controllo in fondo al riquadro Access and Permissions.
Fare clic sul pulsante OK per pubblicare il certificato. Si torna così alla finestra principale di PKI Proxy.
L’elenco di testo sotto Gestione certificati mostra ora il certificato pubblicato.
Proxy PKI - Cliente¶
Gli strumenti client di PKI Proxy offrono diversi modi per accedere alle chiavi condivise e ai certificati di un server PKI Proxy.
Suggerimento
Il server PKI Proxy contiene gli strumenti client. Pertanto, la macchina che esegue il server può essere anche un client per se stessa.
Installazione¶
Scaricare PKI Proxy 2024 - Client Tools dal sito /n del software.
Aprire il programma di installazione e seguire la procedura guidata.
KSP (Key Storage Provider)¶
PKI Proxy fornisce un KSP per interfacciarsi con il server PKI Proxy. Il KSP consente di utilizzare le API native di Windows con le applicazioni, attraverso l’interfaccia CNG (Cryptography API: Next Generation). Per ulteriori informazioni, consultare la documentazione di PKI Proxy.
PKCS#11¶
PKI Proxy fornisce un modulo PKCS#11 per interfacciarsi con il server PKI Proxy. Per ulteriori informazioni, consultare la documentazione di PKI Proxy.