openssl

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

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] adminopenssl [05/03/2024 - 10:52] – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 ====== OPENSSL ====== ====== OPENSSL ======
  
-**CSR erzeugen**+==== Privaten Schlüssel erzeugen ==== 
 + 
 +<code> 
 +openssl genrsa -aes256 -out dvsdnet.devoteam.de.key.pem 
 + 
 +</code> 
 + 
 +Passphäse aus key löschen 
 + 
 +<code> 
 +openssl rsa -in ${filename}.key -out ${filename}.key 
 + 
 +</code> 
 + 
 + 
 +==== Certificate Signing Request ==== 
 + 
 +-days regelt die Gültigkeit des Zertifikats und überschreibt die default Werte der ssh Konfiguration. Achtung bei openvpn: CN muß mit "locutusvpn" beginnen, da die im Server geprüft wird (Server Parameter –verify-x509-name locutusvpn name-prefix) 
 + 
 +''openssl req -new -key private/openvpn_client_odysseus.key -out certs/openvpn_client_odysseus.req.pem -days 730 '' 
 + 
 +Der csr wird entweder selber signiert oder an eine externe CA gegeben, z.B. StartSSL 
 + 
 +=== Signieren über eigene CA === 
 + 
 +''openssl x509 -req -in certs/openvpn_client_odysseus.req.pem -CA certs/RootCA.cert.pem -CAkey private/RootCA.key.pem -out certs/openvpn_client_odysseus.cert.pem -days 720 '' 
 + 
 +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. 
 + 
 +''mv newcerts/01.pem certs/ cd certs ln -s 01.pem `openssl x509 -hash -noout -in 01.pem`.0 '' 
 + 
 +Einfacher CSR 
 <code> <code>
 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 konvertieren =====+====== Zertifikat Formate und Konvertierung ======
  
-==== 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 ./private/.rand 2048 
 + 
 + 
 +===== Von pfx nach pem =====
  
 global global
-<code> 
  
 +<code>
 openssl pkcs12 -in  [pkcs-12-certificate-and-key-file]  -out  [pem-certificate-and-key-file] openssl pkcs12 -in  [pkcs-12-certificate-and-key-file]  -out  [pem-certificate-and-key-file]
  
Zeile 106: Zeile 147:
 </code> </code>
  
-==== Von crt nach pem ====+ 
 +===== Von crt nach pem =====
  
 <code> <code>
Zeile 112: Zeile 154:
  
 </code> </code>
 +
  
 ====== 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 ==== 
-<code> 
- 
-openssl genrsa -aes256 -out dvsdnet.devoteam.de.key.pem 
- 
-</code> 
- 
-Passphäse aus key löschen 
- 
-<code> 
-openssl rsa -in ${filename}.key -out ${filename}.key 
- 
-</code> 
- 
-====   ==== 
  
  
Zeile 209: Zeile 236:
 Neue Anleitung für opensuse siehe [[http://en.opensuse.org/Apache_Howto_SSL|http://en.opensuse.org/Apache_Howto_SSL]] Neue Anleitung für opensuse siehe [[http://en.opensuse.org/Apache_Howto_SSL|http://en.opensuse.org/Apache_Howto_SSL]]
  
-===== 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 ./private/.rand 2048 
 ====== Easy RSA - gängige Befehle ====== ====== Easy RSA - gängige Befehle ======
  
  • openssl.txt
  • Zuletzt geändert: 15/05/2024 - 13:41
  • von admin