| Overloads | |
|---|---|
| AddDataProtectionEncryption(this CfgBuilder, IDataProtectionProvider, string, Action<EncryptionOptions>) | 添加 Data Protection 加密支持 |
| AddDataProtectionEncryption(this CfgBuilder, string, string, Action<EncryptionOptions>) | 添加 Data Protection 加密支持(使用默认提供者) |
| AddDataProtectionEncryption(this CfgBuilder, DirectoryInfo, string, string, Action<EncryptionOptions>) | 添加 Data Protection 加密支持(使用指定目录存储密钥) |
添加 Data Protection 加密支持
public static Apq.Cfg.CfgBuilder AddDataProtectionEncryption(this Apq.Cfg.CfgBuilder builder, Microsoft.AspNetCore.DataProtection.IDataProtectionProvider provider, string purpose="Apq.Cfg", System.Action<Apq.Cfg.Crypto.EncryptionOptions>? configure=null);
builder Apq.Cfg.CfgBuilder
配置构建器
provider Microsoft.AspNetCore.DataProtection.IDataProtectionProvider
Data Protection 提供者
purpose System.String
保护目的,用于隔离不同用途的加密数据
configure System.Action<Apq.Cfg.Crypto.EncryptionOptions>
加密选项配置委托
Apq.Cfg.CfgBuilder
配置构建器实例,支持链式调用
var dataProtectionProvider = DataProtectionProvider.Create("MyApp");
var cfg = new CfgBuilder()
.AddJson("config.json", level: 0)
.AddDataProtectionEncryption(dataProtectionProvider)
.Build();
添加 Data Protection 加密支持(使用默认提供者)
public static Apq.Cfg.CfgBuilder AddDataProtectionEncryption(this Apq.Cfg.CfgBuilder builder, string applicationName, string purpose="Apq.Cfg", System.Action<Apq.Cfg.Crypto.EncryptionOptions>? configure=null);
builder Apq.Cfg.CfgBuilder
配置构建器
applicationName System.String
应用程序名称,用于密钥隔离
purpose System.String
保护目的
configure System.Action<Apq.Cfg.Crypto.EncryptionOptions>
加密选项配置委托
Apq.Cfg.CfgBuilder
配置构建器实例,支持链式调用
var cfg = new CfgBuilder()
.AddJson("config.json", level: 0)
.AddDataProtectionEncryption("MyApp")
.Build();
添加 Data Protection 加密支持(使用指定目录存储密钥)
public static Apq.Cfg.CfgBuilder AddDataProtectionEncryption(this Apq.Cfg.CfgBuilder builder, System.IO.DirectoryInfo keyDirectory, string applicationName, string purpose="Apq.Cfg", System.Action<Apq.Cfg.Crypto.EncryptionOptions>? configure=null);
builder Apq.Cfg.CfgBuilder
配置构建器
keyDirectory System.IO.DirectoryInfo
密钥存储目录
applicationName System.String
应用程序名称
purpose System.String
保护目的
configure System.Action<Apq.Cfg.Crypto.EncryptionOptions>
加密选项配置委托
Apq.Cfg.CfgBuilder
配置构建器实例,支持链式调用
var cfg = new CfgBuilder()
.AddJson("config.json", level: 0)
.AddDataProtectionEncryption(new DirectoryInfo("/keys"), "MyApp")
.Build();