[QuickTipp] Zertifikatsdatei .pfx aus Zertifikat und Key erstellen (und umgekehrt)

This post was published 9 years 2 months 12 days ago, so the post may be outdated.

Noch ein kleiner Tipp für Zwischendurch: Falls man mal eine Zertifikatsdatei .pfx benötigen sollte, aber nur das Zertifikat (.cer, .crt) und den Key (.key) besitzen sollte, kann man sich mit einem einfachen Befehl mit dem Tool openssl die Zertifikatsdatei erstellen:

openssl pkcs12 -export -out domain.pfx -inkey domain.key -in domain.crt

Update 21.01.2015: Thomas aus den Kommentaren wies mich darauf hin, wie das nun umgekehrt möglich ist: Natürlich gibt es auch hierfür Situationen, wo das durchaus hilfreich sein könnte. Das Extrahieren klappt auch hier mit zwei Befehlen:

Key aus .PFX exportieren: (Achtung: Der Key wird verschlüsselt exportiert!)
openssl pkcs12 -in domain.pfx -nocerts -out domain.key

Zertifikat aus .PFX exportieren:
openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.crt

Das Passwort der Key-Datei kann man mit einem Befehl entfernen – falls man das überhaupt möchte. Man wird zur Bestätigung nach dem Passwort des Zertifikates gefragt.
openssl rsa -in domain.key -out domain_decrypted.key

Quelle #1: stackoverflow.com
Quelle #2: markbrilman.nl

Patrik Kernstock

May I introduce my self? I am Patrik Kernstock, 25 years old, perfectionist, born in Austria and living in Ireland, Cork. Me explained in short: Tech- and security enthusiast, series & movies junky. Interesting in Linux, Container-stuff and many software solutions by Microsoft, Veeam and VMware.

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 Comments
newest
oldest most voted
Inline Feedbacks
View all comments
thomas

Und umgekehrt?

2
0
Would love your thoughts, please comment.x
()
x