<div dir="ltr">I received a pfx file from one our techs. A pfx file is a cert and key, all in one binary file. He needs me to split it out into the cert and the key, so I can create a new request from that key, and then sign a new cert for him.<div><br></div><div>(no, I don't know why he can't just create a new request. And I would revoke the old cert, except that I am unsure of the details he used in naming it, so I don't know what to revoke .. So I am stuck trying to see if I can help the guy, by creating a new request from the private key, presuming I can extract the private key ...)</div><div><br></div><div>Anyways, I found this set of commands</div><div><br></div><div><h1 id="gmail-title-text" class="gmail-with-breadcrumbs" style="margin:0px;padding:5px 0px 0px;color:rgb(23,43,77);font-weight:500;line-height:1.25;letter-spacing:-0.01em;clear:left"><a href="https://wiki.cac.washington.edu/display/infra/Extracting+Certificate+and+Private+Key+Files+from+a+.pfx+File" style="color:rgb(23,43,77);text-decoration-line:none;border-bottom-color:rgb(23,43,77)"><font face="monospace" style="" size="2">Extracting Certificate and Private Key Files from a .pfx File</font></a></h1></div><div><a href="https://wiki.cac.washington.edu/display/infra/Extracting+Certificate+and+Private+Key+Files+from+a+.pfx+File">https://wiki.cac.washington.edu/display/infra/Extracting+Certificate+and+Private+Key+Files+from+a+.pfx+File</a>  <br></div><div><div><br></div><div><ol style="margin:10px 0px 0px;color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:14px"><li>Note: the *.pfx file is in PKCS#12 format and includes both the certificate and the private key.</li><li>Run the following command to export the private key: <code style="font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace">openssl pkcs12 -in certname.pfx -nocerts -out key.pem -nodes</code></li><li>Run the following command to export the certificate: <code style="font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace">openssl pkcs12 -in certname.pfx -nokeys -out cert.pem</code></li><li>Run the following command to remove the passphrase from the private key: <code style="font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Courier,monospace">openssl rsa -in key.pem -out server.key </code></li></ol><div><font color="#172b4d" face="SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Courier, monospace"><span style="font-size:14px"><br></span></font></div></div><div><font color="#172b4d" face="SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Courier, monospace"><span style="font-size:14px">But I'm asked for an "Import password" ..</span></font></div><div><font color="#172b4d" face="SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Courier, monospace"><span style="font-size:14px"><br></span></font></div><div>$ sudo openssl pkcs12 -in requests/DCTRNPS001_cert.pfx -nocerts -out DCTRNPS001_key.pem -nodes<br>Enter Import Password:<br></div><div><br></div><div>And I have no idea what an "import" password is. It's not the password for the private key, so I don't know what it is.</div><div><br></div><div>Pointers, anyone?</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Mike. Leone, <mailto:<a href="mailto:turgon@mike-leone.com" target="_blank">turgon@mike-leone.com</a>><br><br>PGP Fingerprint: 0AA8 DC47 CB63 AE3F C739 6BF9 9AB4 1EF6 5AA5 BCDF<br>Photo Gallery: <<a href="http://www.flickr.com/photos/mikeleonephotos" target="_blank">http://www.flickr.com/photos/mikeleonephotos</a>><br><br>This space reserved for future witticisms ...</div></div></div>