Page History
...
- Workflow variables are provided from environment variables for shell jobs, see JS7 - Job Instruction.
- The job decrypts a secret using the current Agent's Private Key.
Examples:
Code Block language bash title Example for Decryption using Unix Shell collapse true # encrypted result is assumed being available from NEW_VAR environment variable secret=$($JS7_AGENT_HOME/bin/js7_decrypt.sh \ --key=$JS7_AGENT_CONFIG_DIR/private/foobar.key \ --encrypted-key="$(printf "%s" "$NEW_VAR" | cut -d' ' -f 1)" \ --iv="$(printf "%s" "$NEW_VAR" | cut -d' ' -f 2)" \ --in="$(printf "%s" "$NEW_VAR" | cut -d' ' -f 3)") echo $secret
Code Block language powershell title Example for Decryption using Windows Shell collapse true @rem encrypted result is assumed being available from NEW_VAR environment variable for /f "tokens=1-3" %%i in ("%NEW_VAR%") do ( set encrypted_symmetric_key=%%i set encrypted_base64_iv=%%j set encrypted_string=%%k ) call "%JS7_AGENT_HOME%\bin\js7_decrypt.cmd" ^ "--key=%JS7_AGENT_CONFIG_DIR%\private\foobar.key" ^ "--encrypted-key=%encrypted_symmetric_key%" ^ "--iv=%encrypted_base64_iv%" ^ "--in=%encrypted_string%" @echo %JS7_DECRYPT_VALUE%
Code Block language powershell title Example for Decryption using PowerShell collapse true # encrypted result is assumed being available from NEW_VAR environment variable $secret = Invoke-JS7Decrypt -Value $env:NEW_VAR -KeyPath $JS7$env:JS7_AGENT_CONFIG_DIR/private/foobar.key -JavaLib $JS7$env:JS7_AGENT_HOME/lib Write-Output $secret
...
- JS7 - Encryption and Decryption
- JS7 - How to encrypt and decrypt Variables
- JS7 - How to update a Job Resource using Unix Shell
- JS7 - How to encrypt and decrypt Database Credentials
...
Overview
Content Tools