openssl

Dies ist eine alte Version des Dokuments!


OPENSSL

Bei RSA Schlüsseln wird automatisch ein Passwort abgefragt. Das kann man in einem zweiten Schritt wieder entfernen:

openssl genrsa -aes256 -out dvsdnet.devoteam.de.key.pem

Passphrase aus key löschen (RSA)

openssl rsa -in ${filename}.key -out ${filename}.key

Diese Schlüssel sind kleiner, bein Erzeugen wird kein Passwort verlangt

openssl ecparam -name prime256v1 -genkey -noout -out key.pem

ec Key mit Passwort erzeugen

openssl ecparam -name prime256v1 -genkey | openssl ec -aes256 -out key.pem

-days regelt die Gültigkeit des Zertifikats und überschreibt die default Werte der ssh Konfiguration.

Der csr wird entweder selber signiert oder an eine externe CA gegeben.

Einfacher CSR

openssl req -nodes -new -newkey rsa:2048 -sha256 -out csr.pem

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

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

openssl req -new -key radius_rsa.key -out radius.xdc.dev.gspp-eu.corpinter.net_rsa.csr -config openssl.cnf

cnf Datei

[ req ]
default_bits           = 2048
default_keyfile        = privkey.key
distinguished_name     = req_distinguished_name
attributes             = req_attributes
req_extensions         = v3_ca

dirstring_type = nobmp

[ req_distinguished_name ]
C                      = DE
ST                     = Baden-Wuerttemberg
L                      = Stuttgart
O                      = Mercedes-Benz Group AG
CN                     = Common Name
emailAddress           = test@email.address

[ req_attributes ]
challengePassword              = A challenge password
challengePassword_min          = 4
challengePassword_max          = 20

[ v3_ca ]

subjectKeyIdentifier = hash
basicConstraints = CA:false
keyUsage = nonRepudiation, digitalSignature, keyEncipherment

Replace <public.crt> with the filename of the public certificate.

openssl x509 -noout -modulus -in <public.crt> | openssl md5> /tmp/crt.pub

openssl rsa -noout -modulus -in <private.key> | openssl md5> /tmp/key.pub
  • openssl.1723823412.txt.gz
  • Zuletzt geändert: 17/08/2024 - 07:06
  • (Externe Bearbeitung)