Systém Windows KSP a PKCS#11 s 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žné prípady použitia tohto nastavenia sú:
Code signing
Document signing
Tip
Ďalšie informácie nájdete aj v oficiálnej dokumentácii PKI Proxy.
Predpoklady¶
HSM 2
Initialized
Provisioned with keys and certificates
Windows machine
OpenSC PKCS#11 driver installed (only required on the PKI Proxy Server).
Proxy server PKI - server¶
The PKI Proxy server shares the keys and certificates from a HSM 2 for different users.
Inštalácia¶
Download the PKI Proxy 2024 installer from the /n software website.
Otvorte inštalačný program a postupujte podľa sprievodcu inštaláciou.
V ponuke Štart otvorte aplikáciu PKI Proxy. Ak ste ho nainštalovali do predvoleného umiestnenia, môžete ho spustiť aj nasledujúcim príkazom z dialógového okna Run alebo PowerShell.
C:\Program Files\PKI Proxy 2024\PKIProxy.exePoznámka
Program PKI Proxy sa minimalizuje do systémovej lišty, aj keď je hlavné okno zatvorené.
Service Configuration¶
Podľa nasledujúcich pokynov nakonfigurujte server 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.
Vytvorte nového používateľa kliknutím na tlačidlo New…. Vyberte typ overovania, ktorý je podporovaný všetkými klientmi.
Na paneli ponúk hlavného okna kliknite na tlačidlo Start, čím spustíte službu 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.
Uistite sa, že je otvorené hlavné okno servera PKI Proxy.
Change to the Certificates tab.
Kliknite na tlačidlo New…. Tým sa otvorí okno Share Certificate.
Kliknite na tlačidlo Select Certificate or Key… (Vybrať certifikát alebo kľúč…) v rámčeku okna Certificate. Tým sa otvorí okno Select a Private Key (Vyberte súkromný kľúč).
Prejdite na kartu 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.
Do textového poľa „ “ (Zadajte PIN) zadajte PIN k vášmu 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.
Výber potvrďte kliknutím na tlačidlo OK. Tým sa vrátite do okna Akciový certifikát. V okne sa teraz zobrazia podrobnosti o vybranom certifikáte.
Kliknite na tlačidlo Add… (Pridať…) v rámci okna Access and Permissions (Prístup a oprávnenia). Tým sa otvorí okno Select user (Vybrať používateľa).
Vyberte existujúceho používateľa z rozbaľovacej ponuky alebo vytvorte nového používateľa výberom položky Create New User…. Výber potvrďte kliknutím na tlačidlo OK. Ak sa rozhodnete vytvoriť nového používateľa, zobrazí sa následne okno New User (Nový používateľ).
V okne Share Certificate sa tiež uistite, že sú povolené len požadované operácie pre certifikát alebo generický kľúč. To môžete zmeniť pomocou zaškrtávacích políčok v spodnej časti rámu Prístup a oprávnenia.
Kliknutím na tlačidlo OK zverejnite certifikát. Tým sa vrátite do hlavného okna servera PKI Proxy.
V textovom zozname pod Správa certifikátov sa teraz zobrazuje zverejnený certifikát.
Proxy server PKI - klient¶
Nástroje klienta PKI Proxy poskytujú rôzne spôsoby prístupu k zdieľaným kľúčom a certifikátom zo servera PKI Proxy.
Tip
Server PKI Proxy obsahuje klientske nástroje. Preto počítač, na ktorom je server spustený, môže byť zároveň klientom pre seba samého.
Inštalácia¶
Stiahnite si PKI Proxy 2024 - Client Tools z webovej stránky /n software.
Otvorte inštalačný program a postupujte podľa sprievodcu inštaláciou.
KSP (Key Storage Provider)¶
PKI Proxy poskytuje KSP na prepojenie so serverom PKI Proxy. KSP umožňuje používať natívne API systému Windows s aplikáciami prostredníctvom rozhrania CNG (Cryptography API: Next Generation). Viac informácií nájdete v dokumentácii PKI Proxy.
PKCS#11¶
PKI Proxy poskytuje modul PKCS#11 na prepojenie so serverom PKI Proxy. Viac informácií nájdete v dokumentácii PKI Proxy.