Windows KSP en PKCS#11 met 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.

Connection between HSM 2 and PKI Proxy Server, Client and exposed client interfaces.

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.

Mogelijke gebruikssituaties voor deze opstelling zijn:

  • Code signing

  • Document signing

Tip

Raadpleeg ook de officiële PKI Proxy documentatie voor meer informatie.

Vereisten

  • HSM 2

    • Initialized

    • Provisioned with keys and certificates

  • Windows machine

    • OpenSC PKCS#11 driver installed (only required on the PKI Proxy Server).

PKI-proxy - server

The PKI Proxy server shares the keys and certificates from a HSM 2 for different users.

Installatie

  1. Download the PKI Proxy 2024 installer from the /n software website.

  2. Open het installatieprogramma en volg de installatiewizard.

  3. Open PKI Proxy in het menu Start. Als je het op de standaardlocatie hebt geïnstalleerd, kun je het ook uitvoeren met de volgende opdracht vanuit het dialoogvenster Uitvoeren of de PowerShell.

    C:\Program Files\PKI Proxy 2024\PKIProxy.exe
    

    Notitie

    PKI Proxy wordt geminimaliseerd naar het systeemvak, zelfs als het hoofdvenster gesloten is.

Service Configuration

De onderstaande instructies configureren de PKI Proxy.

  1. Open the PKI Proxy main window.

  2. Change to the Settings tab.

  3. Make sure the checkbox Enable TLS is checked and an appropriate certificate is used.

  4. Change to the Users tab.

  5. Maak een nieuwe gebruiker aan door te klikken op de knop New…. Kies een verificatietype dat door alle clients wordt ondersteund.

  6. Klik in de menubalk van het hoofdvenster op de knop Start om de PKI Proxy-service te starten.

Publish Certificates from the HSM 2

In the following we configure which certificates from the HSM 2 are made available through PKI Proxy.

  1. Zorg ervoor dat het hoofdvenster van PKI Proxy geopend is.

  2. Change to the Certificates tab.

  3. Klik op de knop New…. Hiermee wordt het venster Aandeelcertificaat geopend.

  4. Klik op de knop Certificaat of sleutel selecteren… in het kader Certificaat van het venster. Hierdoor wordt het venster Select a Private Key geopend.

  5. Ga naar het tabblad Security Key.

  6. 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.

  7. 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.

  8. Voer in het tekstveld „ PIN“ de pincode voor uw HSM 2 in.

  9. Click the Open button.

  10. 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.

  11. Klik op de knop OK om de selectie te bevestigen. U keert nu terug naar het venster Aandeelcertificaat. Het venster toont nu de details van het geselecteerde certificaat.

  12. Klik op de knop Add… in het kader Access and Permissions van het venster. Hierdoor wordt het venster Gebruiker selecteren geopend.

  13. Selecteer een bestaande gebruiker in het vervolgkeuzemenu of maak een nieuwe gebruiker aan door te kiezen voor Nieuwe gebruiker maken…. Klik op de knop OK om de selectie te bevestigen. Als u ervoor kiest om een nieuwe gebruiker aan te maken, wordt daarna het venster Nieuwe gebruiker weergegeven.

  14. Zorg er in het venster Share Certificate ook voor dat alleen de vereiste bewerkingen voor het certificaat of de generieke sleutel zijn toegestaan. Dit kan worden gewijzigd met de selectievakjes onderaan het kader Access and Permissions.

  15. Klik op de knop OK om het certificaat te publiceren. Dit brengt je terug naar het hoofdvenster van PKI Proxy.

  16. De tekstlijst onder Certificaatbeheer toont nu het gepubliceerde certificaat.

PKI Proxy - Klant

De PKI Proxy client tools bieden verschillende manieren om toegang te krijgen tot de gedeelde sleutels en certificaten van een PKI Proxy server.

Tip

De PKI Proxy server bevat de client tools. De machine waarop de server draait kan dus ook een client voor zichzelf zijn.

Installatie

  1. Download de PKI Proxy 2024 - Client Tools van de /n softwarewebsite.

  2. Open het installatieprogramma en volg de installatiewizard.

KSP (Key Storage Provider)

PKI Proxy biedt een KSP om te interfacen met de PKI Proxy server. De KSP maakt het mogelijk om native Windows API’s te gebruiken met toepassingen via de CNG (Cryptography API: Next Generation) interface. Raadpleeg de PKI Proxy documentatie voor meer informatie.

PKCS#11

PKI Proxy biedt een PKCS#11 module om te interfacen met de PKI Proxy server. Raadpleeg de PKI Proxy documentatie voor meer informatie.