1 implementation of Protect
Microsoft.AspNetCore.DataProtection.Extensions (1)
TimeLimitedDataProtector.cs (1)
48
public byte[]
Protect
(byte[] plaintext, DateTimeOffset expiration)
6 references to Protect
Microsoft.AspNetCore.DataProtection.Extensions (2)
DataProtectionAdvancedExtensions.cs (2)
28
return protector.
Protect
(plaintext, DateTimeOffset.UtcNow + lifetime);
120
return _innerProtector.
Protect
(plaintext, Expiration);
Microsoft.AspNetCore.DataProtection.Extensions.Tests (4)
DataProtectionAdvancedExtensionsTests.cs (3)
23
mockDataProtector.Setup(o => o.
Protect
(plaintextAsBytes, expiration)).Returns(new byte[] { 0x01, 0x02 });
39
mockDataProtector.Setup(o => o.
Protect
(plaintextAsBytes, It.IsAny<DateTimeOffset>()))
62
mockDataProtector.Setup(o => o.
Protect
(new byte[] { 0x11, 0x22, 0x33 }, It.IsAny<DateTimeOffset>()))
TimeLimitedDataProtectorTests.cs (1)
35
var protectedPayload = subProtector.
Protect
(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }, expiration);