Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| lx:ucs:ca [28.03.2025 15:27] – Extended Key Usage for CodeSigning Andy Haubenschmid | lx:ucs:ca [25.07.2026 22:13] (aktuell) – berechnung der Tage in eine Variable schreiben Andy Haubenschmid | ||
|---|---|---|---|
| Zeile 10: | Zeile 10: | ||
| ===== neues Server Zertifikat erstellen ===== | ===== neues Server Zertifikat erstellen ===== | ||
| + | Ausrechnen wie lange das Zertifikat laufen darf, am besten das Ablaufdatum der CA verwenden. | ||
| < | < | ||
| echo \(`date -d 18-Oct-2027 +' | echo \(`date -d 18-Oct-2027 +' | ||
| - | . / | + | |
| declare -x ServerName=FQHN | declare -x ServerName=FQHN | ||
| - | univention-certificate new -name " | + | declare -x days=$(echo \(`date -d 18-Oct-2027 +' |
| + | </ | ||
| + | Somit sind die Anzahl Tage und der Servername in Variablen gespeichert und können im folgenden benutzt werden. | ||
| + | < | ||
| + | . / | ||
| + | univention-certificate new -name " | ||
| cd / | cd / | ||
| nano openssl.cnf | nano openssl.cnf | ||
| Zeile 25: | Zeile 31: | ||
| openssl req -new -key private.key -config openssl.cnf -out req.pem | openssl req -new -key private.key -config openssl.cnf -out req.pem | ||
| openssl req -in req.pem -noout -text | grep -E " | openssl req -in req.pem -noout -text | grep -E " | ||
| - | univention-certificate renew -name ${ServerName} -days 1825 | + | univention-certificate renew -name ${ServerName} -days $days |
| </ | </ | ||
| + | |||
| + | das ganze kann dann in eine pkcs12 Datei verpackt werden, damit sie z.B. unter Windows importiert werden kann: | ||
| + | < | ||
| + | openssl pkcs12 -export -out / | ||
| + | -in / | ||
| + | -inkey / | ||
| + | -passout pass: | ||
| + | </ | ||
| + | |||
| Zertifikatsfingerabdruck auslesen und auf dem Terminalserver via | Zertifikatsfingerabdruck auslesen und auf dem Terminalserver via | ||
| '' | '' | ||
| Zeile 69: | Zeile 84: | ||
| [[https:// | [[https:// | ||
| ===== CodeSigning ===== | ===== CodeSigning ===== | ||
| - | Extended Use key flag -eku 1.3.6.1.5.5.7.3.3 so the cert can be used for code signing | + | To be recognized as a CodeSigning Certificate, |
| + | |||
| + | To generate a CodeSigning Cert with the Univention CA, follow these steps: | ||
| + | - create a new cert by using univention-certificate new, use a name you recognize as CS Cert | ||
| + | - create a special extension file | ||
| + | - generate the cert again manually by the CA with the extension | ||
| + | - use this cert for signing | ||
| + | |||
| + | < | ||
| + | declare -x CertName=CodeSign-YourName | ||
| + | declare -x ExportPassword=SuperSecurePasswordForP12File | ||
| + | declare -x days=$(echo \(`date -d 18-Oct-2027 +' | ||
| + | |||
| + | . / | ||
| + | univention-certificate new -name " | ||
| + | cd / | ||
| + | |||
| + | echo " | ||
| + | authorityKeyIdentifier = keyid, | ||
| + | basicConstraints | ||
| + | subjectAltName | ||
| + | extendedKeyUsage | ||
| + | [alt_names] | ||
| + | DNS.1 = ${CertName} | ||
| + | " > code_sign_cert.conf | ||
| + | |||
| + | grep output_password / | ||
| + | openssl x509 -req -CA ../ | ||
| + | |||
| + | openssl pkcs12 -export -out / | ||
| + | </ | ||
| + | |||
| + | created with thanks to the infos found here: [[https:// | ||