3 implementations of GetCacheableKeyRing
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingProvider.cs (1)
496CacheableKeyRing ICacheableKeyRingProvider.GetCacheableKeyRing(DateTimeOffset now)
Microsoft.AspNetCore.DataProtection.Tests (2)
KeyManagement\KeyRingBasedDataProtectorTests.cs (2)
354public CacheableKeyRing GetCacheableKeyRing(DateTimeOffset now) => _keyRing; 369public CacheableKeyRing GetCacheableKeyRing(DateTimeOffset now)
35 references to GetCacheableKeyRing
KeyManagementSimulator (1)
Program.cs (1)
392var keyRing = _cacheableKeyRingProvider.GetCacheableKeyRing(now);
Microsoft.AspNetCore.DataProtection (2)
KeyManagement\KeyRingProvider.cs (2)
274newCacheableKeyRing = CacheableKeyRingProvider.GetCacheableKeyRing(utcNow); 367utcNowState => CacheableKeyRingProvider.GetCacheableKeyRing((DateTime)utcNowState!),
Microsoft.AspNetCore.DataProtection.Tests (32)
KeyManagement\KeyRingProviderTests.cs (32)
44var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 87var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 135var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 183Assert.Throws<InvalidOperationException>(() => keyRingProvider.GetCacheableKeyRing(now)); // The would-be default key is revoked 224var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 264var exception = Assert.Throws<InvalidOperationException>(() => keyRingProvider.GetCacheableKeyRing(now)); 308var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 348var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 386var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 509var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 555var cacheableKeyRing = keyRingProvider.GetCacheableKeyRing(now); 580.Setup(o => o.GetCacheableKeyRing(now)) 595mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(It.IsAny<DateTimeOffset>()), Times.Once); 607.Setup(o => o.GetCacheableKeyRing(now)) 613.Setup(o => o.GetCacheableKeyRing(now + TimeSpan.FromMinutes(1))) 619.Setup(o => o.GetCacheableKeyRing(now + TimeSpan.FromMinutes(2))) 636mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(It.IsAny<DateTimeOffset>()), Times.Exactly(2)); 648.Setup(o => o.GetCacheableKeyRing(now)) 654.Setup(o => o.GetCacheableKeyRing(now + TimeSpan.FromHours(1))) 669mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(It.IsAny<DateTimeOffset>()), Times.Exactly(2)); 694.Setup(o => o.GetCacheableKeyRing(now)) 720mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(It.IsAny<DateTimeOffset>()), Times.Once); 731mockCacheableKeyRingProvider.Setup(o => o.GetCacheableKeyRing(originalKeyRingTime)) 734mockCacheableKeyRingProvider.Setup(o => o.GetCacheableKeyRing(throwKeyRingTime)).Throws(new Exception("How exceptional.")); 737mockCacheableKeyRingProvider.Setup(o => o.GetCacheableKeyRing(updatedKeyRingTime)) 747mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(originalKeyRingTime), Times.Once); 748mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(throwKeyRingTime), Times.Once); 749mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(updatedKeyRingTime), Times.Once); 823.Setup(o => o.GetCacheableKeyRing(time1)) 829.Setup(o => o.GetCacheableKeyRing(time2)) 854mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(time1), Times.Once); 862mockCacheableKeyRingProvider.Verify(o => o.GetCacheableKeyRing(time2), Times.AtMost(taskCount - 1));