From 32f1f9e33f40ba89f5295a66b6af15bf9a17e1e2 Mon Sep 17 00:00:00 2001 From: trimstray Date: Fri, 12 Jul 2019 09:46:02 +0200 Subject: [PATCH] add new one-liners to 'openssl' - signed-off-by: trimstray --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e56ff53..7594f5f 100644 --- a/README.md +++ b/README.md @@ -2308,6 +2308,20 @@ openssl x509 -signkey ${_fd} -nodes \ openssl dhparam -out /etc/nginx/ssl/dhparam_4096.pem 4096 ``` +###### Extract private key from pfx + +```bash +( _fd_pfx="cert.pfx" ; _fd_key="key.pem" ; \ +openssl pkcs12 -in ${_fd_pfx} -nocerts -nodes -out ${_fd_key} ) +``` + +###### Extract private key and certs from pfx + +```bash +( _fd_pfx="cert.pfx" ; _fd_pem="key_certs.pem" ; \ +openssl pkcs12 -in ${_fd_pfx} -nodes -out ${_fd_pem} ) +``` + ###### Convert DER to PEM ```bash