13 implementations of CreateProtector
Aspire.Dashboard.Tests (1)
LocalBrowserStorageTests.cs (1)
154public IDataProtector CreateProtector(string purpose)
Microsoft.AspNetCore.Authentication.Test (1)
CookieTests.cs (1)
1736public IDataProtector CreateProtector(string purpose)
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
RazorComponentResultTest.cs (2)
500public IDataProtector CreateProtector(string purpose) 505public IDataProtector CreateProtector(string purpose) => this;
Microsoft.AspNetCore.Components.Server.Tests (2)
ProtectedBrowserStorageTest.cs (2)
305public IDataProtector CreateProtector(string purpose) 320public IDataProtector CreateProtector(string purpose)
Microsoft.AspNetCore.DataProtection (3)
EphemeralDataProtectionProvider.cs (1)
67public IDataProtector CreateProtector(string purpose)
KeyManagement\KeyRingBasedDataProtectionProvider.cs (1)
22public IDataProtector CreateProtector(string purpose)
KeyManagement\KeyRingBasedDataProtector.cs (1)
60public IDataProtector CreateProtector(string purpose)
Microsoft.AspNetCore.DataProtection.Extensions (2)
DataProtectionAdvancedExtensions.cs (1)
109public IDataProtector CreateProtector(string purpose)
TimeLimitedDataProtector.cs (1)
107IDataProtector IDataProtectionProvider.CreateProtector(string purpose)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
CookieTempDataProviderTest.cs (2)
419public IDataProtector CreateProtector(string purpose) 431public IDataProtector CreateProtector(string purpose)
75 references to CreateProtector
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgeryTokenSerializer.cs (1)
25_cryptoSystem = provider.CreateProtector(Purpose);
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTokenSerializerTest.cs (1)
151.Setup(p => p.CreateProtector(It.IsAny<string>()))
Microsoft.AspNetCore.Authentication (2)
SecureDataFormat.cs (2)
42protector = protector.CreateProtector(purpose); 74protector = protector.CreateProtector(purpose);
Microsoft.AspNetCore.Authentication.Test (3)
SecureDataFormatTests.cs (3)
25var prototector = provider.CreateProtector("test"); 38var prototector = provider.CreateProtector("test"); 52var prototector = provider.CreateProtector("test");
Microsoft.AspNetCore.Components.Endpoints (3)
Builder\OpaqueRedirection.cs (1)
99return dataProtectionProvider.CreateProtector(RedirectionDataProtectionProviderPurpose).ToTimeLimitedDataProtector();
DependencyInjection\ServerComponentSerializer.cs (1)
16.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose)
src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs (1)
31_protector = dataProtectionProvider.CreateProtector("Microsoft.AspNetCore.Components.Server.State");
Microsoft.AspNetCore.Components.Endpoints.Tests (8)
EndpointHtmlRendererTest.cs (8)
300var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 332var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 393var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 450var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 489var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 528var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 579var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose) 1054var protector = _dataprotectorProvider.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose)
Microsoft.AspNetCore.Components.Server (4)
Circuits\CircuitIdFactory.cs (1)
25_protector = provider.CreateProtector(CircuitIdProtectorPurpose);
Circuits\ServerComponentDeserializer.cs (1)
86.CreateProtector(ServerComponentSerializationSettings.DataProtectionProviderPurpose)
ProtectedBrowserStorage\ProtectedBrowserStorage.cs (1)
152_dataProtectionProvider.CreateProtector);
src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs (1)
31_protector = dataProtectionProvider.CreateProtector("Microsoft.AspNetCore.Components.Server.State");
Microsoft.AspNetCore.DataProtection (1)
DataProtectionServiceCollectionExtensions.cs (1)
94dataProtectionProvider = dataProtectionProvider.CreateProtector(dpOptions.Value.ApplicationDiscriminator);
Microsoft.AspNetCore.DataProtection.Abstractions (4)
DataProtectionCommonExtensions.cs (4)
28/// <see cref="IDataProtectionProvider.CreateProtector(string)"/>. See that method's 44retVal = retVal.CreateProtector(purpose) ?? CryptoUtil.Fail<IDataProtector>("CreateProtector returned null."); 67/// <see cref="IDataProtectionProvider.CreateProtector(string)"/>. See that method's 79IDataProtector? protector = provider.CreateProtector(purpose);
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (18)
DataProtectionCommonExtensionsTests.cs (18)
25mockProtector.Setup(o => o.CreateProtector(It.IsAny<string>())).Returns(mockProtector.Object); 42mockProtector.Setup(o => o.CreateProtector(It.IsAny<string>())).Returns(mockProtector.Object); 59thirdMock.Setup(o => o.CreateProtector("third")).Returns(finalExpectedProtector); 61secondMock.Setup(o => o.CreateProtector("second")).Returns(thirdMock.Object); 63firstMock.Setup(o => o.CreateProtector("first")).Returns(secondMock.Object); 79thirdMock.Setup(o => o.CreateProtector("third")).Returns(finalExpectedProtector); 81secondMock.Setup(o => o.CreateProtector("second")).Returns(thirdMock.Object); 83firstMock.Setup(o => o.CreateProtector("first")).Returns(secondMock.Object); 100firstMock.Setup(o => o.CreateProtector("first")).Returns(finalExpectedProtector); 144mockProtector.Setup(o => o.CreateProtector(It.IsAny<string>())).Returns(mockProtector.Object); 163mockProtector.Setup(o => o.CreateProtector(It.IsAny<string>())).Returns(mockProtector.Object); 182thirdMock.Setup(o => o.CreateProtector("third")).Returns(finalExpectedProtector); 184secondMock.Setup(o => o.CreateProtector("second")).Returns(thirdMock.Object); 186firstMock.Setup(o => o.CreateProtector("first")).Returns(secondMock.Object); 206thirdMock.Setup(o => o.CreateProtector("third")).Returns(finalExpectedProtector); 208secondMock.Setup(o => o.CreateProtector("second")).Returns(thirdMock.Object); 210firstMock.Setup(o => o.CreateProtector("first")).Returns(secondMock.Object); 231firstMock.Setup(o => o.CreateProtector("first")).Returns(finalExpectedProtector);
Microsoft.AspNetCore.DataProtection.Extensions (2)
TimeLimitedDataProtector.cs (2)
33return new TimeLimitedDataProtector(_innerProtector.CreateProtector(purpose)); 42var newValue = _innerProtector.CreateProtector(MyPurposeString); // we always append our purpose to the end of the chain
Microsoft.AspNetCore.DataProtection.Extensions.Tests (20)
DataProtectionProviderTests.cs (12)
34var protector = DataProtectionProvider.Create(directory).CreateProtector("purpose"); 69var protector = provider.CreateProtector("Protector"); 103}).CreateProtector("purpose"); 144var protector = DataProtectionProvider.Create(directory, certificate).CreateProtector("purpose"); 149var unprotector = DataProtectionProvider.Create(directory, o => o.UnprotectKeysWithAnyCertificate(certWithoutKey)).CreateProtector("purpose"); 195var protector = DataProtectionProvider.Create(directory, certWithKey).CreateProtector("purpose"); 198var keylessUnprotector = DataProtectionProvider.Create(directory).CreateProtector("purpose"); 201var unprotector = DataProtectionProvider.Create(directory, o => o.UnprotectKeysWithAnyCertificate(certInStore, certWithKey)).CreateProtector("purpose"); 228var protector = DataProtectionProvider.Create(directory, certificate).CreateProtector("purpose"); 257var protector = DataProtectionProvider.Create("Test", certificate).CreateProtector("purpose"); 299.CreateProtector("purpose"); 314Assert.Equal("payload", unprotector.CreateProtector("purpose").Unprotect(data));
TimeLimitedDataProtectorTests.cs (8)
25mockInnerProtector.Setup(o => o.CreateProtector("new purpose").CreateProtector(TimeLimitedPurposeString).Protect( 48mockInnerProtector.Setup(o => o.CreateProtector("new purpose").CreateProtector(TimeLimitedPurposeString).Protect( 72mockInnerProtector.Setup(o => o.CreateProtector(TimeLimitedPurposeString).Unprotect(new byte[] { 0x10, 0x11 })).Returns( 96mockInnerProtector.Setup(o => o.CreateProtector(TimeLimitedPurposeString).Unprotect(new byte[] { 0x10, 0x11 })).Returns( 118mockInnerProtector.Setup(o => o.CreateProtector(TimeLimitedPurposeString).Unprotect(new byte[] { 0x10, 0x11 })).Returns( 139mockInnerProtector.Setup(o => o.CreateProtector(TimeLimitedPurposeString).Unprotect(new byte[] { 0x10, 0x11 })).Throws(new Exception("How exceptional!"));
Microsoft.AspNetCore.Identity (1)
DataProtectorTokenProvider.cs (1)
33Protector = dataProtectionProvider.CreateProtector(Name ?? "DataProtectorTokenProvider");
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
ComponentTagHelperTest.cs (1)
89x => x.CreateProtector(It.IsAny<string>()) == Mock.Of<IDataProtector>()))
PersistComponentStateTagHelperTest.cs (2)
31_ephemeralProvider.CreateProtector("Microsoft.AspNetCore.Components.Server.State"); 261x => x.CreateProtector(It.IsAny<string>()) == _protector))
ProtectedPrerenderComponentApplicationStateTest.cs (1)
15private static readonly IDataProtector _protector = _provider.CreateProtector("Microsoft.AspNetCore.Components.Server.State");
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
CookieTempDataProvider.cs (1)
44_dataProtector = dataProtectionProvider.CreateProtector(Purpose);
Microsoft.AspNetCore.Session (1)
SessionMiddleware.cs (1)
50_dataProtector = dataProtectionProvider.CreateProtector(nameof(SessionMiddleware));
NonDISample (1)
Program.cs (1)
27var protector = dataProtectionProvider.CreateProtector("Program.No-DI");