Problem
In my current project, we have several certificate providers, so we use the certificate factory. Also, we use data protection and protect keys with a certificate. The problem is that DataProtectionBuilderExtensions.ProtectKeysWithCertificate requires a certificate directly, for which we need a certificate factory, but for getting a factory, we need an IServiceProvider.
Solution
We need to add a method overload with the following parameters.
public static IDataProtectionBuilder ProtectKeysWithCertificate(this IDataProtectionBuilder builder, Func<IServiceProvider, X509Certificate2 > factory){...}
Similar existing solutions
A similar solution already exists for AddKeyEscrowSink, but not for ProtectKeysWithCertificate.
public static IDataProtectionBuilder AddKeyEscrowSink(this IDataProtectionBuilder builder, Func<IServiceProvider, IKeyEscrowSink> factory){...}
Problem
In my current project, we have several certificate providers, so we use the certificate factory. Also, we use data protection and protect keys with a certificate. The problem is that
DataProtectionBuilderExtensions.ProtectKeysWithCertificaterequires a certificate directly, for which we need a certificate factory, but for getting a factory, we need anIServiceProvider.Solution
We need to add a method overload with the following parameters.
Similar existing solutions
A similar solution already exists for
AddKeyEscrowSink, but not forProtectKeysWithCertificate.