Class SecureSmsConfig
java.lang.Object
cloud.opencode.base.sms.config.SecureSmsConfig
- All Implemented Interfaces:
AutoCloseable
Secure SMS Config
安全短信配置
Wrapper for SMS config that protects sensitive data.
保护敏感数据的短信配置包装器。
Features | 主要功能:
- Stores credentials as char[] for secure clearing - 使用char[]存储凭据以便安全清除
- Implements AutoCloseable for credential cleanup - 实现AutoCloseable用于凭据清理
- Volatile cleared flag for thread visibility - volatile标志确保线程可见性
Usage Examples | 使用示例:
try (SecureSmsConfig config = new SecureSmsConfig(httpConfig)) {
String apiUrl = config.getApiUrl();
// use config...
} // credentials are cleared on close
Security | 安全性:
- Thread-safe: Yes (synchronized access to credentials) - 线程安全: 是(同步访问凭据)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-sms V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSecureSmsConfig(HttpSmsConfig config) Create secure config from HTTP config 从HTTP配置创建安全配置 -
Method Summary
-
Constructor Details
-
SecureSmsConfig
Create secure config from HTTP config 从HTTP配置创建安全配置- Parameters:
config- the HTTP config | HTTP配置
-
-
Method Details
-
getName
-
getApiUrl
-
getAppId
Get app ID 获取应用ID- Returns:
- the app ID | 应用ID
- Throws:
IllegalStateException- if already cleared | 如果已清除则抛出异常
-
getAppKey
Get app key 获取应用密钥- Returns:
- the app key | 应用密钥
- Throws:
IllegalStateException- if already cleared | 如果已清除则抛出异常
-
getSignName
-
clear
public void clear()Clear sensitive data 清除敏感数据 -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
toString
-