diff options
| author | David Leutgeb <david@noreply.localhost> | 2024-05-27 12:32:27 +0200 |
|---|---|---|
| committer | David Leutgeb <david@noreply.localhost> | 2024-05-27 12:32:27 +0200 |
| commit | c62e494bb13bf094919d34168f4739c62d849835 (patch) | |
| tree | ce126f0b163fac76baff2eae07c3598eaf49a778 /convert.sh | |
| parent | b2a0e9b6c8f0341169500bbee85a2d7b488d3bb3 (diff) | |
| download | certconvert-main.tar.gz certconvert-main.zip | |
Diffstat (limited to 'convert.sh')
| -rw-r--r-- | convert.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/convert.sh b/convert.sh new file mode 100644 index 0000000..ea4aab5 --- /dev/null +++ b/convert.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +echo "Please insert full path to the pfx file!" + +read certpath + +echo "Please insert new name off cert! (e.g. srv-01)!" + +read certname + +#Extract the certificate from the pfx file + +openssl pkcs12 -in $certpath -clcerts -nokeys -out $certname.crt + +#Extract private key from the pfx file + +openssl pkcs12 -in $certpath -nocerts -nodes -out $certname.key + +#Extract chain from the pfx file + +openssl pkcs12 -in $certpath -out $certname.chain.crt -nodes -nokeys -cacerts
\ No newline at end of file |