1 interface inheriting from IDataProtectionProvider
Microsoft.AspNetCore.DataProtection.Abstractions (1)
IDataProtector.cs (1)
11public interface IDataProtector : IDataProtectionProvider
5 implementations of IDataProtectionProvider
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
RazorComponentResultTest.cs (1)
498class FakeDataProtectionProvider : IDataProtectionProvider
Microsoft.AspNetCore.Components.Server.Tests (1)
ProtectedBrowserStorageTest.cs (1)
295class TestDataProtectionProvider : IDataProtectionProvider
Microsoft.AspNetCore.DataProtection (2)
EphemeralDataProtectionProvider.cs (1)
27public sealed class EphemeralDataProtectionProvider : IDataProtectionProvider
KeyManagement\KeyRingBasedDataProtectionProvider.cs (1)
11internal sealed unsafe class KeyRingBasedDataProtectionProvider : IDataProtectionProvider
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
CookieTempDataProviderTest.cs (1)
410private class PassThroughDataProtectionProvider : IDataProtectionProvider
130 references to IDataProtectionProvider
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgeryTokenSerializer.cs (1)
19IDataProtectionProvider provider,
Microsoft.AspNetCore.Antiforgery.Test (3)
DefaultAntiforgeryTokenSerializerTest.cs (3)
12private static readonly Mock<IDataProtectionProvider> _dataProtector = GetDataProtector(); 139private static Mock<IDataProtectionProvider> GetDataProtector() 149var provider = new Mock<IDataProtectionProvider>();
Microsoft.AspNetCore.Authentication (1)
RemoteAuthenticationOptions.cs (1)
82public IDataProtectionProvider? DataProtectionProvider { get; set; }
Microsoft.AspNetCore.Authentication.BearerToken (3)
BearerTokenConfigureOptions.cs (1)
9internal sealed class BearerTokenConfigureOptions(IDataProtectionProvider dp) : IConfigureNamedOptions<BearerTokenOptions>
BearerTokenOptions.cs (2)
45/// bearer token. If not provided, one will be created using <see cref="TicketDataFormat"/> and the <see cref="IDataProtectionProvider"/> 56/// refresh token. If not provided, one will be created using <see cref="TicketDataFormat"/> and the <see cref="IDataProtectionProvider"/>
Microsoft.AspNetCore.Authentication.Cookies (4)
CookieAuthenticationOptions.cs (1)
61public IDataProtectionProvider? DataProtectionProvider { get; set; }
PostConfigureCookieAuthenticationOptions.cs (3)
14private readonly IDataProtectionProvider _dp; 19/// <param name="dataProtection">The <see cref="IDataProtectionProvider"/>.</param> 20public PostConfigureCookieAuthenticationOptions(IDataProtectionProvider dataProtection)
Microsoft.AspNetCore.Authentication.OAuth (3)
OAuthPostConfigureOptions.cs (3)
19private readonly IDataProtectionProvider _dp; 24/// <param name="dataProtection">The <see cref="IDataProtectionProvider"/>.</param> 25public OAuthPostConfigureOptions(IDataProtectionProvider dataProtection)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
OpenIdConnectPostConfigureOptions.cs (3)
18private readonly IDataProtectionProvider _dp; 23/// <param name="dataProtection">The <see cref="IDataProtectionProvider"/>.</param> 24public OpenIdConnectPostConfigureOptions(IDataProtectionProvider dataProtection)
Microsoft.AspNetCore.Authentication.Test (6)
SecureDataFormatTests.cs (6)
24var provider = ServiceProvider.GetRequiredService<IDataProtectionProvider>(); 37var provider = ServiceProvider.GetRequiredService<IDataProtectionProvider>(); 51var provider = ServiceProvider.GetRequiredService<IDataProtectionProvider>();
Microsoft.AspNetCore.Authentication.Twitter (3)
TwitterPostConfigureOptions.cs (3)
15private readonly IDataProtectionProvider _dp; 20/// <param name="dataProtection">The <see cref="IDataProtectionProvider"/>.</param> 21public TwitterPostConfigureOptions(IDataProtectionProvider dataProtection)
Microsoft.AspNetCore.Authentication.WsFederation (2)
WsFederationPostConfigureOptions.cs (2)
18private readonly IDataProtectionProvider _dp; 24public WsFederationPostConfigureOptions(IDataProtectionProvider dataProtection)
Microsoft.AspNetCore.Components.Endpoints (10)
Builder\OpaqueRedirection.cs (2)
98var dataProtectionProvider = httpContext.RequestServices.GetRequiredService<IDataProtectionProvider>();
DependencyInjection\RazorComponentsServiceCollectionExtensions.cs (1)
56services.TryAddSingleton<ServerComponentSerializer>(services => new ServerComponentSerializer(services.GetRequiredService<IDataProtectionProvider>()));
DependencyInjection\ServerComponentSerializer.cs (1)
14public ServerComponentSerializer(IDataProtectionProvider dataProtectionProvider) =>
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (3)
44InteractiveServerRenderMode => new ProtectedPrerenderComponentApplicationStore(_httpContext.RequestServices.GetRequiredService<IDataProtectionProvider>()), 65var serverStore = new ProtectedPrerenderComponentApplicationStore(_httpContext.RequestServices.GetRequiredService<IDataProtectionProvider>()); 143var protectedStore = new ProtectedPrerenderComponentApplicationStore(_httpContext.RequestServices.GetRequiredService<IDataProtectionProvider>());
src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs (3)
13public ProtectedPrerenderComponentApplicationStore(IDataProtectionProvider dataProtectionProvider) : base() 18public ProtectedPrerenderComponentApplicationStore(string existingState, IDataProtectionProvider dataProtectionProvider) 30private void CreateProtector(IDataProtectionProvider dataProtectionProvider) =>
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
EndpointHtmlRendererTest.cs (1)
39private static readonly IDataProtectionProvider _dataprotectorProvider = new EphemeralDataProtectionProvider();
RazorComponentResultTest.cs (1)
464.AddSingleton<IDataProtectionProvider, FakeDataProtectionProvider>()
Microsoft.AspNetCore.Components.Server (14)
Circuits\CircuitIdFactory.cs (1)
23public CircuitIdFactory(IDataProtectionProvider provider)
Circuits\ServerComponentDeserializer.cs (1)
73IDataProtectionProvider dataProtectionProvider,
ComponentHub.cs (2)
40private readonly IDataProtectionProvider _dataProtectionProvider; 49IDataProtectionProvider dataProtectionProvider,
ProtectedBrowserStorage\ProtectedBrowserStorage.cs (3)
18private readonly IDataProtectionProvider _dataProtectionProvider; 27/// <param name="dataProtectionProvider">The <see cref="IDataProtectionProvider"/>.</param> 28private protected ProtectedBrowserStorage(string storeName, IJSRuntime jsRuntime, IDataProtectionProvider dataProtectionProvider)
ProtectedBrowserStorage\ProtectedLocalStorage.cs (2)
24/// <param name="dataProtectionProvider">The <see cref="IDataProtectionProvider"/>.</param> 25public ProtectedLocalStorage(IJSRuntime jsRuntime, IDataProtectionProvider dataProtectionProvider)
ProtectedBrowserStorage\ProtectedSessionStorage.cs (2)
24/// <param name="dataProtectionProvider">The <see cref="IDataProtectionProvider"/>.</param> 25public ProtectedSessionStorage(IJSRuntime jsRuntime, IDataProtectionProvider dataProtectionProvider)
src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs (3)
13public ProtectedPrerenderComponentApplicationStore(IDataProtectionProvider dataProtectionProvider) : base() 18public ProtectedPrerenderComponentApplicationStore(string existingState, IDataProtectionProvider dataProtectionProvider) 30private void CreateProtector(IDataProtectionProvider dataProtectionProvider) =>
Microsoft.AspNetCore.Components.Server.Tests (8)
Circuits\CircuitHostTest.cs (4)
21private readonly IDataProtectionProvider _ephemeralDataProtectionProvider = new EphemeralDataProtectionProvider(); 196await circuitHost.InitializeAsync(new ProtectedPrerenderComponentApplicationStore(Mock.Of<IDataProtectionProvider>()), cancellationToken); 239var initializeTask = circuitHost.InitializeAsync(new ProtectedPrerenderComponentApplicationStore(Mock.Of<IDataProtectionProvider>()), cancellationToken); 269var initializeAsyncTask = circuitHost.InitializeAsync(new ProtectedPrerenderComponentApplicationStore(Mock.Of<IDataProtectionProvider>()), new CancellationToken());
Circuits\RemoteRendererTest.cs (1)
30private readonly IDataProtectionProvider _ephemeralDataProtectionProvider = new EphemeralDataProtectionProvider();
Circuits\ServerComponentDeserializerTest.cs (1)
13private readonly IDataProtectionProvider _ephemeralDataProtectionProvider;
ProtectedBrowserStorageTest.cs (1)
372public TestProtectedBrowserStorage(string storeName, IJSRuntime jsRuntime, IDataProtectionProvider dataProtectionProvider)
src\Components\Endpoints\src\DependencyInjection\ServerComponentSerializer.cs (1)
14public ServerComponentSerializer(IDataProtectionProvider dataProtectionProvider) =>
Microsoft.AspNetCore.DataProtection (6)
DataProtectionBuilderExtensions.cs (1)
521builder.Services.Replace(ServiceDescriptor.Singleton<IDataProtectionProvider, EphemeralDataProtectionProvider>());
DataProtectionServiceCollectionExtensions.cs (2)
83services.TryAddSingleton<IDataProtectionProvider>(s => 89IDataProtectionProvider dataProtectionProvider = new KeyRingBasedDataProtectionProvider(keyRingProvider, loggerFactory);
EphemeralDataProtectionProvider.cs (3)
20/// An <see cref="IDataProtectionProvider"/> that is transient. 32/// Creates an ephemeral <see cref="IDataProtectionProvider"/>. 39/// Creates an ephemeral <see cref="IDataProtectionProvider"/> with logging.
Microsoft.AspNetCore.DataProtection.Abstractions (20)
DataProtectionCommonExtensions.cs (20)
22/// <param name="provider">The <see cref="IDataProtectionProvider"/> from which to generate the purpose chain.</param> 28/// <see cref="IDataProtectionProvider.CreateProtector(string)"/>. See that method's 31public static IDataProtector CreateProtector(this IDataProtectionProvider provider, IEnumerable<string> purposes) 37IDataProtectionProvider retVal = provider; 60/// <param name="provider">The <see cref="IDataProtectionProvider"/> from which to generate the purpose chain.</param> 67/// <see cref="IDataProtectionProvider.CreateProtector(string)"/>. See that method's 70public static IDataProtector CreateProtector(this IDataProtectionProvider provider, string purpose, params string[] subPurposes) 88/// Retrieves an <see cref="IDataProtectionProvider"/> from an <see cref="IServiceProvider"/>. 90/// <param name="services">The service provider from which to retrieve the <see cref="IDataProtectionProvider"/>.</param> 91/// <returns>An <see cref="IDataProtectionProvider"/>. This method is guaranteed never to return null.</returns> 92/// <exception cref="InvalidOperationException">If no <see cref="IDataProtectionProvider"/> service exists in <paramref name="services"/>.</exception> 93public static IDataProtectionProvider GetDataProtectionProvider(this IServiceProvider services) 99var provider = (IDataProtectionProvider?)services.GetService(typeof(IDataProtectionProvider)); 102throw new InvalidOperationException(Resources.FormatDataProtectionExtensions_NoService(typeof(IDataProtectionProvider).FullName)); 110/// <param name="services">An <see cref="IServiceProvider"/> which contains the <see cref="IDataProtectionProvider"/> 117/// then <see cref="CreateProtector(IDataProtectionProvider, IEnumerable{string})"/>. See those methods' 131/// <param name="services">An <see cref="IServiceProvider"/> which contains the <see cref="IDataProtectionProvider"/> 139/// then <see cref="CreateProtector(IDataProtectionProvider, string, string[])"/>. See those methods'
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (10)
DataProtectionCommonExtensionsTests.cs (10)
117Assert.Equal(Resources.FormatDataProtectionExtensions_NoService(typeof(IDataProtectionProvider).FullName), ex.Message); 124var expected = new Mock<IDataProtectionProvider>().Object; 126mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(expected); 130var actual = services.GetDataProtectionProvider(); 146mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(mockProtector.Object); 165mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(mockProtector.Object); 189mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(firstMock.Object); 213mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(firstMock.Object); 233mockServices.Setup(o => o.GetService(typeof(IDataProtectionProvider))).Returns(firstMock.Object);
Microsoft.AspNetCore.DataProtection.Extensions (10)
DataProtectionProvider.cs (9)
13/// Contains factory methods for creating an <see cref="IDataProtectionProvider"/> where keys are stored 25public static IDataProtectionProvider Create(string applicationName) 40public static IDataProtectionProvider Create(DirectoryInfo keyDirectory) 55public static IDataProtectionProvider Create( 72public static IDataProtectionProvider Create(string applicationName, X509Certificate2 certificate) 90public static IDataProtectionProvider Create( 109public static IDataProtectionProvider Create( 121internal static IDataProtectionProvider CreateProvider( 143return serviceCollection.BuildServiceProvider().GetRequiredService<IDataProtectionProvider>();
TimeLimitedDataProtector.cs (1)
107IDataProtector IDataProtectionProvider.CreateProtector(string purpose)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (2)
DataProtectionProviderTests.cs (2)
55var provider = DataProtectionProvider.CreateProvider( 312var unprotector = DataProtectionProvider.Create(directory,
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
3510services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>(); 3660services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
Microsoft.AspNetCore.Identity (1)
DataProtectorTokenProvider.cs (1)
24public DataProtectorTokenProvider(IDataProtectionProvider dataProtectionProvider,
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
SqlStoreTestBase.cs (1)
55services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
Microsoft.AspNetCore.Identity.Specification.Tests (2)
IdentitySpecificationTestBase.cs (1)
43services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
UserManagerSpecificationTests.cs (1)
56services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
ComponentTagHelperTest.cs (1)
88.AddScoped(_ => Mock.Of<IDataProtectionProvider>(
PersistComponentStateTagHelperTest.cs (2)
28private static readonly IDataProtectionProvider _ephemeralProvider = 260.AddScoped(_ => Mock.Of<IDataProtectionProvider>(
ProtectedPrerenderComponentApplicationStateTest.cs (1)
14private static readonly IDataProtectionProvider _provider = new EphemeralDataProtectionProvider();
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
CookieTempDataProvider.cs (2)
34/// <param name="dataProtectionProvider">The <see cref="IDataProtectionProvider"/>.</param> 39IDataProtectionProvider dataProtectionProvider,
Microsoft.AspNetCore.Session (2)
SessionMiddleware.cs (2)
32/// <param name="dataProtectionProvider">The <see cref="IDataProtectionProvider"/> used to protect and verify the cookie.</param> 38IDataProtectionProvider dataProtectionProvider,
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
Startup.cs (1)
67services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
VersionStartup.cs (1)
30services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
Microsoft.AspNetCore.SignalR.Tests (1)
Startup.cs (1)
74services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();
NonDISample (1)
Program.cs (1)
16var dataProtectionProvider = DataProtectionProvider.Create(
SignalR.Client.FunctionalTestApp (1)
Startup.cs (1)
101services.AddSingleton<IDataProtectionProvider, EphemeralDataProtectionProvider>();