Ziel
- Überblick über gebräuchliche Container-Formate für Zertifikate und Schlüssel
- Verständnis für Aufbau, Inhalt und Einsatzgebiete
- Entscheidungshilfe für den praktischen Einsatz
Containerformate für Zertifikate und Schlüssel
PKCS#12 (.p12, .pfx)
- Binärformat
- Enthält privaten Schlüssel, Zertifikat und optional CA-Zertifikate
- Mit Passwortschutz
- Verwendung: Thunderbird, Outlook, Windows, Browser
- Ideal für E-Mail-Verschlüsselung (S/MIME)
- Erzeugung mit OpenSSL
- openssl pkcs12 -export -inkey priv.key -in cert.crt -certfile ca.crt -out bundle.p12
PKCS#7 (.p7b, .p7c)
- Binär oder Base64-Text
- Enthält nur Zertifikate (kein privater Schlüssel!)
- Oft als Zertifikatskette mit Root- und Zwischenzertifikaten
- Verwendung: Exchange, Java, Windows
- Erzeugung mit OpenSSL
- openssl crl2pkcs7 -nocrl -certfile cert.crt -certfile ca.crt -out bundle.p7b
PEM (.pem, .crt, .key)
- Base64-Textformat mit Klartext-Headern
- Kann Zertifikate, private Schlüssel oder beides enthalten
- Sehr flexibel und weit verbreitet in Linux/Unix
- Verwendung: Apache, NGINX, OpenSSL
- Beispielinhalt
-----BEGIN CERTIFICATE-----
MIID...
-----END CERTIFICATE-----
DER (.der, .cer)
- Binärformat
- Enthält ein einzelnes X.509-Zertifikat
- Verwendung: Windows, Java, mobile Geräte
- Konvertierung mit OpenSSL
- openssl x509 -in cert.pem -outform der -out cert.der
Textformate vs. Binärformate
Textformate (Base64-kodiert)
- PEM, PGP (.asc), manchmal PKCS#7
- Lesbar, einfach übertragbar, ideal für Konfiguration
- Vorteil: direkt kopierbar, gut für Skripte
Binärformate
- PKCS#12, PKCS#7, DER
- Nicht lesbar, aber strukturierter
- Oft für Import in grafische Tools oder Java-Systeme benötigt
Vergleichstabelle
| Format |
Endung(en) |
Inhalt |
Typ |
Einsatzbereich |
Private Keys möglich?
|
| PEM |
.pem, .crt, .key |
Zertifikat, Key, Chain |
Text (Base64) |
Linux, Apache, NGINX, OpenSSL |
Ja
|
| DER |
.der, .cer |
Einzelnes Zertifikat |
Binär |
Windows, Java |
Nein
|
| PKCS#7 |
.p7b, .p7c |
Zertifikat + Chain |
Binär oder Text |
Windows, Exchange, Java |
Nein
|
| PKCS#12 |
.p12, .pfx |
Zertifikat, Chain, Key |
Binär |
Thunderbird, Outlook, Browser |
Ja
|
| OpenPGP |
.asc |
PGP-Schlüssel |
Text (Base64) |
E-Mail, Dateien (Thunderbird, GnuPG) |
Ja
|