dotnet / dotnet/aspnetcore

Add the ability to delay the receipt of a certificate in the extension method DataProtectionBuilderExtensions.ProtectKeysWithCertificate

Open
#23,033 10 comments 24 reactions 0 assignees View on GitHub
affected-medium area-dataprotection enhancement severity-minor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### 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.

``` C#
public static IDataProtectionBuilder ProtectKeysWithCertificate(this IDataProtectionBuilder builder, Func factory){...}
```

### Similar existing solutions
A similar solution already exists for `AddKeyEscrowSink`, but not for `ProtectKeysWithCertificate`.
``` C#
public static IDataProtectionBuilder AddKeyEscrowSink(this IDataProtectionBuilder builder, Func factory){...}
```

Contributor guide

Open the contributing guide

Research direction

Start at DataProtectionBuilderExtensions.ProtectKeysWithCertificate and compare its current certificate handling with the existing AddKeyEscrowSink factory overload. Add the requested IServiceProvider-based overload so certificate receipt can be delayed; done means callers can supply Func alongside the existing API.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.