private static IDataProtectionBuilder ProtectKeysWithAwsKmsConfig(this IDataProtectionBuilder builder, IAmazonKeyManagementService kmsClient, IConfiguration config) { builder.Services.Configure <KmsXmlEncryptorConfig>(config); return(builder.ProtectKeysWithAwsKmsImpl(kmsClient, sp => sp.GetRequiredService <IOptions <KmsXmlEncryptorConfig> >())); }
private static IDataProtectionBuilder ProtectKeysWithAwsKmsRaw(this IDataProtectionBuilder builder, IAmazonKeyManagementService kmsClient, IKmsXmlEncryptorConfig config) { builder.Services.AddSingleton <IConfigureOptions <KmsXmlEncryptorConfig> >(new DirectConfigure(config)); return(builder.ProtectKeysWithAwsKmsImpl(kmsClient, sp => sp.GetRequiredService <IOptions <KmsXmlEncryptorConfig> >())); }