Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste ÜberarbeitungBeide Seiten der Revision | ||
openssl [19/02/2024 - 16:36] – [Certificate Signing Request] admin | openssl [05/03/2024 - 10:52] – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== OPENSSL ====== | ====== OPENSSL ====== | ||
- | **CSR erzeugen** | + | ==== Privaten Schlüssel |
+ | |||
+ | < | ||
+ | openssl genrsa -aes256 -out dvsdnet.devoteam.de.key.pem | ||
+ | |||
+ | </ | ||
+ | |||
+ | Passphäse aus key löschen | ||
+ | |||
+ | < | ||
+ | openssl rsa -in ${filename}.key -out ${filename}.key | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Certificate Signing Request ==== | ||
+ | |||
+ | -days regelt die Gültigkeit des Zertifikats und überschreibt die default Werte der ssh Konfiguration. Achtung bei openvpn: CN muß mit " | ||
+ | |||
+ | '' | ||
+ | |||
+ | Der csr wird entweder selber signiert oder an eine externe CA gegeben, z.B. StartSSL | ||
+ | |||
+ | === Signieren über eigene CA === | ||
+ | |||
+ | '' | ||
+ | |||
+ | Achtung: Beim Signieren über die eigene CA werden die Zertifikat-Nr hochgezählt (serial in srl Datei). Die srl Datei muss auch für die ServerCA separat existieren. | ||
+ | |||
+ | '' | ||
+ | |||
+ | Einfacher CSR | ||
< | < | ||
openssl req -nodes -new -newkey rsa:2048 -sha256 -out csr.pem | openssl req -nodes -new -newkey rsa:2048 -sha256 -out csr.pem | ||
Zeile 60: | Zeile 92: | ||
Alternativ über doveadmin, siehe dort. | Alternativ über doveadmin, siehe dort. | ||
- | ===== Zertifikat Formate | + | ====== Zertifikat Formate |
- | ==== Von pfx nach pem ==== | + | ===== PKCS Dateien erzeugen (*.pfx, *.p12) ===== |
+ | |||
+ | openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile more.crt * | ||
+ | |||
+ | openssl – the command for executing OpenSSL * pkcs12 – the file utility for PKCS#12 files in OpenSSL * - export - out certificate .pfx – export and save the PFX file as certificate.pfx * - inkey privateKey .key – use the private key file privateKey.key as the private key to combine with the certificate. * - in certificate .crt – use certificate.crt as the certificate the private key will be combined with. * - certfile more .crt – | ||
+ | |||
+ | This is optional, this is if you have any additional certificates you would like to include in the PFX file. **User Zertifikat erzeugen** wie Server Zertifikat. Für VPN Verbindung kann ohne Passwort gearbeitet werden, es geht aber auch mit Passwort! openssl genrsa -aes256 -out apache.key.pem -rand ./ | ||
+ | |||
+ | |||
+ | ===== Von pfx nach pem ===== | ||
global | global | ||
- | < | ||
+ | < | ||
openssl pkcs12 -in [pkcs-12-certificate-and-key-file] | openssl pkcs12 -in [pkcs-12-certificate-and-key-file] | ||
Zeile 106: | Zeile 147: | ||
</ | </ | ||
- | ==== Von crt nach pem ==== | + | |
+ | ===== Von crt nach pem ===== | ||
< | < | ||
Zeile 112: | Zeile 154: | ||
</ | </ | ||
+ | |||
====== Certification Authority ====== | ====== Certification Authority ====== | ||
Zeile 185: | Zeile 228: | ||
Mit der ServerCA lassen sich jetzt Zertifikate für Server erstellen. Diese sollten - weil sie ihren Private Key ohne menschliches Zutun benutzen müssen - keine Passphrase haben. Dies geschieht durch Weglassen des Verschlüsselungs-Algoritmus beim Erstellen des Private Key. Ansonsten sind das auch nur normale Zertifikate. Allerdings werden sie nicht von der RootCA, sondern von der ServerCA signiert. | Mit der ServerCA lassen sich jetzt Zertifikate für Server erstellen. Diese sollten - weil sie ihren Private Key ohne menschliches Zutun benutzen müssen - keine Passphrase haben. Dies geschieht durch Weglassen des Verschlüsselungs-Algoritmus beim Erstellen des Private Key. Ansonsten sind das auch nur normale Zertifikate. Allerdings werden sie nicht von der RootCA, sondern von der ServerCA signiert. | ||
- | |||
- | ==== Privaten Schlüssel erzeugen ==== | ||
- | < | ||
- | |||
- | openssl genrsa -aes256 -out dvsdnet.devoteam.de.key.pem | ||
- | |||
- | </ | ||
- | |||
- | Passphäse aus key löschen | ||
- | |||
- | < | ||
- | openssl rsa -in ${filename}.key -out ${filename}.key | ||
- | |||
- | </ | ||
- | |||
- | ==== ==== | ||
Zeile 209: | Zeile 236: | ||
Neue Anleitung für opensuse siehe [[http:// | Neue Anleitung für opensuse siehe [[http:// | ||
- | ===== PKCS Dateien erzeugen (*.pfx, *.p12) | + | ===== |
- | openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile more.crt * | ||
- | openssl – the command for executing OpenSSL * pkcs12 – the file utility for PKCS#12 files in OpenSSL * - export - out certificate .pfx – export and save the PFX file as certificate.pfx * - inkey privateKey .key – use the private key file privateKey.key as the private key to combine with the certificate. * - in certificate .crt – use certificate.crt as the certificate the private key will be combined with. * - certfile more .crt – | ||
- | |||
- | This is optional, this is if you have any additional certificates you would like to include in the PFX file. **User Zertifikat erzeugen** wie Server Zertifikat. Für VPN Verbindung kann ohne Passwort gearbeitet werden, es geht aber auch mit Passwort! openssl genrsa -aes256 -out apache.key.pem -rand ./ | ||
====== Easy RSA - gängige Befehle ====== | ====== Easy RSA - gängige Befehle ====== | ||