getSecret
Retrieves a secret value from environment variables.
SECURITY NOTICE: Secrets are returned as Strings because the underlying OS APIs (environment variables, system properties) return Strings. The String cannot be cleared from memory.
Best practices:
Use platform-specific secure storage when possible (Keychain, KeyStore)
Use short-lived tokens instead of long-lived secrets
Rotate secrets regularly
Don't log or print secret values
For maximum security, consider using:
Secrets management services (HashiCorp Vault, AWS Secrets Manager)
Platform secure storage APIs
Memory-mapped files with OS-level protection
Return
The secret value, or null if not found
Parameters
name
The secret key