Class SignConfigurationProperties
java.lang.Object
tech.riemann.nif.starter.security.sign.SignConfigurationProperties
签名验证配置属性类
用于从配置文件中读取签名验证相关配置。
本类只承载开关与策略参数,不承载任何密钥。 签名密钥一律由业务方通过
AppSecretProvider(对称算法:HMAC_SHA256 / SM3)或
AppKeyProvider(非对称算法:SM2 / RSA)以 Bean 形式提供,
典型来源为数据库、配置中心或 KMS。框架不内置任何从配置文件读取密钥的实现,
避免密钥随配置文件泄漏或被当作"万能钥匙"兜底。
配置前缀:nif.web.sign
配置示例:
nif:
web:
sign:
enabled: true
default-expire-seconds: 300
@Bean
public AppSecretProvider appSecretProvider(SecretDao dao) {
return appId -> dao.findSecret(appId); // 未注册的 appId 返回 null,验签直接失败
}
- Author:
- Kerbores(kerbores@riemann.tech)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SignConfigurationProperties
public SignConfigurationProperties()
-