Cifrado de correo electrónico S/MIME¶
Compatible Nitrokeys |
|||||||
|---|---|---|---|---|---|---|---|
✓ active |
⨯ inactive |
⨯ inactive |
✓ active |
⨯ inactive |
✓ active |
✓ active |
⨯ inactive |
Requisitos previos¶
Existen dos estándares ampliamente utilizados para el cifrado del correo electrónico.
OpenPGP/GnuPG es popular entre los particulares,
S/MIME/X.509 es utilizado principalmente por las empresas.
If you are in doubt which one to choose, you should use OpenPGP, see here (not applicable for the Nitrokey HSM 2, the Nitrokey HSM 2 currently supports the S/MIME/X.509 standard though, therefore the rest of the guide is applicable for the HSM 2 and other Nitrokeys). This page describes the usage of S/MIME email encryption.
You need to purchase a S/MIME certificate (e.g. at CERTUM) or may already got one by your company. Furthermore, you need to install OpenSC on your System. While GNU/Linux users usually can install OpenSC over the package manager (e.g. sudo apt install opensc on Ubuntu), macOS and Windows users can download the installation files from the OpenSC page.
Nota
¡Los usuarios de Windows con un sistema de 64 bits (estándar) deben instalar tanto la versión de 32 bits como la de 64 bits de OpenSC!
Importar la clave y el certificado existentes¶
Las siguientes instrucciones se basan en la wiki de OpenSC. Asumiremos que ya tienes un par de claves y certificados en un archivo .p12. Por favor, eche un vistazo a la página de la wiki, si tiene un archivo de clave y certificado separado.
To open the Windows command line please push the Windows-key and R-key. Now type cmd.exe in the text field and hit enter. To open a Terminal on macOS or GNU/Linux please use the application search (e.g. spotlight on macOS).
To make these commands as simple as possible, the .p12 file needs to be in your home folder. On Windows this is usually C:\Users\yourusername and on macOS and GNU/Linux system it will be /home/yourusername. If you do not store the .p12 file there, you have to adapt the path in the commands below. Please plug in the Nitrokey before submitting the commands.
Assuming that your key-certificate file reads myprivate.p12 the commands for Windows looks like this:
"C:\Program Files\OpenSC Project\OpenSC\tools\pkcs15-init" --delete-objects privkey,pubkey --id 3 --store-private-key myprivate.p12 --format pkcs12 --auth-id 3 --verify-pin
"C:\Program Files\OpenSC Project\OpenSC\tools\pkcs15-init" --delete-objects privkey,pubkey --id 2 --store-private-key myprivate.p12 --format pkcs12 --auth-id 3 --verify-pin
y en macOS y GNU/Linux será
$ pkcs15-init --delete-objects privkey,pubkey --id 3 --store-private-key myprivate.p12 --format pkcs12 --auth-id 3 --verify-pin
$ pkcs15-init --delete-objects privkey,pubkey --id 2 --store-private-key myprivate.p12 --format pkcs12 --auth-id 3 --verify-pin
Los dos comandos copian el par clave-certificado en la ranura 2 (necesaria para descifrar los correos electrónicos) y en la ranura 3 (necesaria para firmar). La salida se ve en ambos sistemas algo así:
Tenga en cuenta que habrá mensajes de error que se pueden ignorar con seguridad (véase el ejemplo de salida anterior). Ahora tiene el par clave-certificado cargado en el Nitrokey.
Uso¶
Puede encontrar más información sobre el uso en estas páginas: