Windows KSP y 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.

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.

Los posibles casos de uso de esta configuración son:

  • Code signing

  • Document signing

Truco

Consulte también la documentación oficial de PKI Proxy para obtener más información.

Requisitos previos

  • HSM 2

    • Initialized

    • Provisioned with keys and certificates

  • Windows machine

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

Proxy PKI - Servidor

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

Instalación

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

  2. Abra el instalador y siga el asistente de instalación.

  3. Abra PKI Proxy desde el menú Inicio. Si lo instaló en la ubicación predeterminada, también puede ejecutarlo con el siguiente comando desde el cuadro de diálogo Ejecutar o PowerShell.

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

    Nota

    PKI Proxy se minimizará a la bandeja del sistema, incluso si la ventana principal está cerrada.

Service Configuration

Las instrucciones siguientes configuran el proxy PKI.

  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. Cree un nuevo usuario haciendo clic en el botón New…. Elija un tipo de autenticación compatible con todos los clientes.

  6. En la barra de menús de la ventana principal, haga clic en el botón Iniciar para iniciar el servicio 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.

  1. Asegúrese de que la ventana principal del Proxy PKI está abierta.

  2. Change to the Certificates tab.

  3. Haga clic en el botón Nuevo…. Se abrirá la ventana Certificado de acciones.

  4. Haga clic en el botón Seleccionar certificado o clave…, en el marco Certificado de la ventana. Se abrirá la ventana Seleccionar una clave privada.

  5. Cambie a la pestaña 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. En el campo de texto « PIN», introduce el PIN de tu HSM 2.

  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. Haga clic en el botón OK para confirmar la selección. Volverá a la ventana Certificado de acciones. La ventana mostrará ahora los detalles del certificado seleccionado.

  12. Haga clic en el botón Añadir…, en el marco Acceso y permisos de la ventana. Se abrirá la ventana Seleccionar usuario.

  13. Seleccione un usuario existente en el menú desplegable, o cree uno nuevo eligiendo Crear nuevo usuario…. Haga clic en el botón OK para confirmar la selección. Si elige crear un nuevo usuario, a continuación se mostrará la ventana Nuevo usuario.

  14. De vuelta a la ventana Compartir certificado asegúrese también de permitir sólo las operaciones requeridas para el certificado o la clave genérica. Esto se puede cambiar con las casillas de verificación de la parte inferior del marco Access and Permissions.

  15. Haga clic en el botón OK para publicar el certificado. Volverá a la ventana principal de PKI Proxy.

  16. La lista de texto situada bajo Certificate Management muestra ahora el certificado publicado.

Proxy PKI - Cliente

Las herramientas cliente del Proxy PKI proporcionan diferentes formas de acceder a las claves y certificados compartidos desde un servidor Proxy PKI.

Truco

El servidor proxy PKI contiene las herramientas cliente. Por lo tanto, la máquina que ejecuta el servidor también puede ser un cliente para sí misma.

Instalación

  1. Descargue PKI Proxy 2024 - Client Tools del sitio web del software /n.

  2. Abra el instalador y siga el asistente de instalación.

KSP (Key Storage Provider)

PKI Proxy proporciona un KSP para interactuar con el servidor PKI Proxy. El KSP permite el uso de API nativas de Windows con aplicaciones, a través de la interfaz CNG (Cryptography API: Next Generation). Consulte la documentación de PKI Proxy para obtener más información.

PKCS#11

PKI Proxy proporciona un módulo PKCS#11 para interactuar con el servidor PKI Proxy. Consulte la documentación de PKI Proxy para obtener más información.