8 implementations of Protect
Aspire.Dashboard.Tests (1)
LocalBrowserStorageTests.cs (1)
159public byte[] Protect(byte[] plaintext)
Microsoft.AspNetCore.Authentication.Test (1)
CookieTests.cs (1)
1741public byte[] Protect(byte[] plaintext)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
RazorComponentResultTest.cs (1)
506public byte[] Protect(byte[] plaintext) => new byte[] { 1, 2, 3 };
Microsoft.AspNetCore.Components.Server.Tests (1)
ProtectedBrowserStorageTest.cs (1)
325public byte[] Protect(byte[] plaintext)
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingBasedDataProtector.cs (1)
89public byte[] Protect(byte[] plaintext)
Microsoft.AspNetCore.DataProtection.Extensions (2)
DataProtectionAdvancedExtensions.cs (1)
116public byte[] Protect(byte[] plaintext)
TimeLimitedDataProtector.cs (1)
114byte[] IDataProtector.Protect(byte[] plaintext)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
CookieTempDataProviderTest.cs (1)
437public byte[] Protect(byte[] plaintext)
26 references to Protect
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgeryTokenSerializer.cs (1)
156var bytes = _cryptoSystem.Protect(stream.ToArray());
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTokenSerializerTest.cs (1)
142mockCryptoSystem.Setup(o => o.Protect(It.IsAny<byte[]>()))
Microsoft.AspNetCore.Authentication (1)
SecureDataFormat.cs (1)
45var protectedData = protector.Protect(userData);
Microsoft.AspNetCore.Components.Endpoints (1)
src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs (1)
27return _protector != null ? _protector.Protect(bytes) : bytes;
Microsoft.AspNetCore.Components.Server (2)
Circuits\CircuitIdFactory.cs (1)
45var secret = _protector.Protect(buffer);
src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs (1)
27return _protector != null ? _protector.Protect(bytes) : bytes;
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyManagementOptions.cs (1)
36/// to <see cref="IDataProtector.Protect(byte[])"/> may fail. The system may end up
Microsoft.AspNetCore.DataProtection.Abstractions (1)
DataProtectionCommonExtensions.cs (1)
164byte[] protectedDataAsBytes = protector.Protect(plaintextAsBytes);
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (1)
DataProtectionCommonExtensionsTests.cs (1)
262mockProtector.Setup(p => p.Protect(new byte[] { 0x48, 0x65, 0x6c, 0x6c, 0x6f })).Returns(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 });
Microsoft.AspNetCore.DataProtection.Extensions (1)
TimeLimitedDataProtector.cs (1)
57return GetInnerProtectorWithTimeLimitedPurpose().Protect(plaintextWithHeader);
Microsoft.AspNetCore.DataProtection.Extensions.Tests (4)
TimeLimitedDataProtectorTests.cs (4)
25mockInnerProtector.Setup(o => o.CreateProtector("new purpose").CreateProtector(TimeLimitedPurposeString).Protect( 48mockInnerProtector.Setup(o => o.CreateProtector("new purpose").CreateProtector(TimeLimitedPurposeString).Protect( 58var protectedPayload = subProtector.Protect(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }); 160byte[] ephemeralProtectedPayload = ephemeralProtector.Protect(new byte[] { 0x01, 0x02, 0x03, 0x04 });
Microsoft.AspNetCore.DataProtection.Tests (8)
EphemeralDataProtectionProviderTests.cs (3)
22byte[] protectedBytes = dataProtector1.Protect(bytes); 39byte[] protectedBytes = dataProtector1.Protect(bytes); 56byte[] protectedBytes = dataProtector1.Protect(bytes);
KeyManagement\KeyRingBasedDataProtectorTests.cs (5)
31ExceptionAssert.ThrowsArgumentNull(() => protector.Protect(plaintext: null), "plaintext"); 66byte[] retVal = protector.Protect(expectedPlaintext); 104byte[] retVal = protector.Protect(expectedPlaintext); 121var ex = ExceptionAssert2.ThrowsCryptographicException(() => protector.Protect(new byte[0])); 615byte[] retVal = protector.Protect(expectedPlaintext);
Microsoft.AspNetCore.Identity (1)
DataProtectorTokenProvider.cs (1)
93var protectedBytes = Protector.Protect(ms.ToArray());
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
ProtectedPrerenderComponentApplicationStateTest.cs (1)
45var persistedState = Convert.ToBase64String(_protector.Protect(JsonSerializer.SerializeToUtf8Bytes(expectedState)));
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
CookieTempDataProvider.cs (1)
113bytes = _dataProtector.Protect(bytes);
Microsoft.AspNetCore.Session (1)
CookieProtection.cs (1)
22var protectedData = protector.Protect(userData);