IPSec¶
Compatible Nitrokeys |
|||||||
|---|---|---|---|---|---|---|---|
✓ active |
⨯ inactive |
✓ active |
✓ active |
⨯ inactive |
✓ active |
✓ active |
⨯ inactive |
strongSwan works using the PKCS#11 driver. Basically follow these steps:
Erzeugen Sie einen Schlüssel auf Nitrokey über pkcs11-tool. In diesem Beispiel handelt es sich um einen 4096-Bit-RSA-Schlüssel.
$ pkcs11-tool --module /usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so -l -k --key-type rsa:4096 --id 10 --label 'Staging Access'
Erzeugen einer Zertifikatssignierungsanforderung über das openssl + pkcs11 Modul
$ openssl OpenSSL> engine dynamic -pre SO_PATH:/usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so OpenSSL> req -engine pkcs11 -sha256 -new -key id_10 -keyform engine -out user@email.com-staging-cert.csr -subj '/C=GB/L=Cambridge/O=Organization/OU=Staging Access/CN=user@email.com/emailAddress=user@email.com'
Signieren Sie das Zertifikat mit Ihrer Zertifizierungsstelle
Das Zertifikat in DER umwandeln
$ openssl x509 -in user@email.com-staging-cert.csr -out user@email.com-staging-cert.der -outform DER
Importieren Sie das Zertifikat in den Nitrokey über pkcs11-tool
$ pkcs11-tool --module /usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so -l -y cert -w user@email.com-staging-cert.der --id 10 --label 'Staging Access'
Configure strongSwan to load OpenSC’s PKCS#11 module then to load the certificate on Nitrokey. Edit
/etc/strongswan.d/charon/pkcs11.confand add the following module:modules { Nitrokey { path = /usr/lib/x86_64-linux-gnu/pkcs11/opensc-pkcs11.so } }Initiate the VPN connection via IPSec/strongSwan, then prompt for Nitrokey PIN
VPN ist jetzt verbunden