/// <summary> /// Configures the data protection system to encrypt keys using AWS Key Management Service master keys /// </summary> /// <param name="builder">The <see cref="IDataProtectionBuilder"/>.</param> /// <param name="config">Provide the configuration object specifying how to use KMS keys e.g. from configuration section.</param> /// <returns>A reference to the <see cref="IDataProtectionBuilder" /> after this operation has completed.</returns> public static IDataProtectionBuilder ProtectKeysWithAwsKms(this IDataProtectionBuilder builder, IConfiguration config) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (config == null) { throw new ArgumentNullException(nameof(config)); } return(builder.ProtectKeysWithAwsKmsConfig(null, config)); }
/// <summary> /// Configures the data protection system to encrypt keys using AWS Key Management Service master keys /// </summary> /// <param name="builder">The <see cref="IDataProtectionBuilder"/>.</param> /// <param name="kmsClient">KMS client configured with appropriate credentials.</param> /// <param name="config">Provide the configuration object specifying how to use KMS keys e.g. from configuration section.</param> /// <returns>A reference to the <see cref="IDataProtectionBuilder" /> after this operation has completed.</returns> public static IDataProtectionBuilder ProtectKeysWithAwsKms(this IDataProtectionBuilder builder, IAmazonKeyManagementService kmsClient, IConfiguration config) { if (builder == null) { throw new ArgumentNullException(nameof(builder)); } if (kmsClient == null) { throw new ArgumentNullException(nameof(kmsClient)); } if (config == null) { throw new ArgumentNullException(nameof(config)); } return(builder.ProtectKeysWithAwsKmsConfig(kmsClient, config)); }