Configuring Environment Variables
The Application-Plugin mode requires authentication before connecting to the encryption platform to retrieve encrypted fields and the corresponding keys; this authentication information is determined by the AK and SK. The Application-Plugin mode retrieves this value from environment variables.
The configuration of environment variables varies depending on the different program execution modes; you may select one from the following configurations.
Edit the Application Startup Script
If configuration isolation is required, different applications can use distinct environment variable values without interfering with each other; this approach can be referenced for configuring the AK and SK.
Operation method: Modify the application system's startup script.
#!/bin/bash # start.sh-Startup script name # Configure environment variables export API_AK=<AK obtained from encryption platform> export API_SK=<SK obtained from encryption platform> # Launch App java -jar your-app.jar
Edit ~/.profile
If the change should only apply to the current user, you may refer to this approach.
Operation method: Edit the configuration file.
# 1. Edit configuration file vi ~/.profile # 2. Add the following content to the end of the document. export API_AK=<AK obtained from encryption platform> export API_SK=<SK obtained from encryption platform> # 3. Save and Exit # 4. Apply the configuration immediately source ~/.profile # 5. Verify whether it has taken effect echo $API_AK
Write to /etc/profile.d/*.sh
If you need to use a multi-user shared system or environment variables, we recommend modifying them according to the following method.
Operation method: Modify the system's automatic execution script.
# Create Configuration File sudo vi /etc/profile.d/app.sh # Add Content export API_AK=<AK obtained from encryption platform> export API_SK=<SK obtained from encryption platform> #come into force source /etc/profile
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot