Erzeugen einer CA
Erzeugen eines Schlssels
openssl genrsa -aes256 -out privkey.pem 2048
Erzeugen eines Certificate Signining Requests
openssl req -new -key privkey.pem -out cacert.csr
Certificate Signining Request in CA Certificate umwandeln
openssl x509 -req -in cacert.csr -extensions v3_ca -signkey privkey.pem -out cacert.pem -days 7300
Erzeugen von Client Certificates
Erzeugen eines Schlüssels
openssl genrsa -aes256 -out privkey.pem 2048
oder ohne Passphrase:
openssl genrsa -out privkey.pem 2048
Passphrase von Private Key entfernen
openssl rsa -in privkey.pem -out privkey.pem
Erzeugen eines Certificate Signining Requests
openssl req -new -sha256 -key privkey.pem -out cert.csr
Signieren des Requests
openssl x509 -req -sha256 -in cert.csr -out certificate.pem -CA ../dont_panic_CA/cacert.pem -CAkey ../dont_panic_CA/privkey.pem -CAcreateserial -days 7300
Wenn das Zertifikat und der Private Key in einem File sein mssen:
cat privkey.pem >> certificate.pem
Exportieren des Zertifikats in das PKCS12 Format
openssl pkcs12 -export -in certificate.pem -out certificate.p12 -name "My Certificate"
Die umgekehrte Richtung; Cert und Key aus PKCS12 Format extrahieren
openssl pkcs12 -in star_bludenz_at.pfx -nokeys -out star_bludenz_at.crt
openssl pkcs12 -in star_bludenz_at.pfx -nocerts -out star_bludenz_at.key
Root CA zu Linux CA Store hinzufügen
/usr/share/ca-certificates/dont_pani
scp ~/Nextcloud/CA/dont_panic_CA/dont_panic_CA/cacert.pem /usr/share/ca-certificates/dont_panic/dont_panic.crt
update-ca-certificates
# pkg-reconfigure ca-certificates
/usr/share/ca-certificates/dont_pani
scp ~/Nextcloud/CA/dont_panic_CA/dont_panic_CA/cacert.pem /usr/share/ca-certificates/dont_panic/dont_panic.crt
update-ca-certificates
# pkg-reconfigure ca-certificates
Zertifikat Inhalt ansehen
openssl x509 -text -in /etc/postfix/ssl/TrashRazor.crt
Signing Request ansehen:
openssl req -noout -text -in host.csr
Erzeugen von Client Zertifikaten ohne User Befragung
Erzeugen eines Keys und eines Certificate Signing Requests
openssl req -batch -config ./config -new -out cert.csr
Signieren des CSR
openssl x509 -req -passin pass:3m51wg5u5 -in cert.csr -out certificate.pem -CA VPN_CA/cacert.pem -CAkey VPN_CA/private/cakey.pem -CAcreateserial -days 730
Revoken
openssl ca -config config -revoke VPN_CA/newcerts/2D.pem -keyfile VPN_CA/private/cakey.pem -cert VPN_CA/cacert.pem
Erzeugen von Diffie-Hellman Parametern
openssl gendh -out /etc/postfix/ssl/dh_1024.pem -2 1024
Convert a DER file (.crt .cer .der) to PEM
openssl x509 -inform der -in certificate.cer -out certificate.pem