-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/main' into next
# Conflicts: # package.json
- Loading branch information
Showing
6 changed files
with
55 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,4 @@ public/version.json | |
/blob-report/ | ||
/playwright/.cache/ | ||
**/key.pem | ||
**/client_certificate.pfx |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# stackoverflow -> https://stackoverflow.com/questions/65097173/azure-key-vault-download-certificate-with-private-key | ||
|
||
eval "$(jq -r '@sh "export $short_env=\(.env)"')" | ||
|
||
# Define the passphrase for the PKCS#12 file. | ||
passphrase="" | ||
|
||
pkcs12_file="client_certificate.pfx" | ||
certificate_name='pagopa-d-weu-selfcare-jwt-signing-cert' | ||
KeyVaultName='pagopa-d-selfcare-kv' | ||
|
||
# Retrieve the client certificate from the Key Vault | ||
certificate_pfx_base64=$(az keyvault secret show --name ${certificate_name} --vault-name ${KeyVaultName} --query value --output tsv) | ||
|
||
echo "$certificate_pfx_base64" | base64 --decode > client_certificate.pfx | ||
|
||
# Extract private key and certificates | ||
openssl pkcs12 -in "$pkcs12_file" -passin "pass:$passphrase" -nocerts -nodes -out key.pem | ||
|
||
json='{"pem": '$(cat key.pem | jq -Rsa . )'}' | ||
echo -n $json |
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