Last active
November 9, 2019 20:46
-
-
Save damienpontifex/c0ff28081c0f202889bf697188822317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Map variables retrieved from Key Vault to environment variables such as: | |
# env: | |
# CERT_DATA: $(certData) | |
# CERT_PASSWORD: $(certPassword) | |
# Read in the PFX data and save as pfx file | |
echo "${CERT_DATA}" | base64 --decode > cert.pfx | |
# Extract out the certificate using the pfx password | |
openssl pkcs12 -nodes -nokeys -passin pass:"${CERT_PASSWORD}" -in cert.pfx -out cert.pem | |
# Extract out the private key using the pfx password | |
openssl pkcs12 -nodes -nocerts -passin pass:"${CERT_PASSWORD}" -in cert.pfx -out cert.key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment