1 implementation of IKey
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\Key.cs (1)
18internal sealed class Key : IKey
52 references to IKey
Microsoft.AspNetCore.DataProtection (52)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (1)
36public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (1)
36public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (1)
36public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
AuthenticatedEncryption\IAuthenticatedEncryptorFactory.cs (3)
15/// Creates an <see cref="IAuthenticatedEncryptor"/> instance based on the given <see cref="IKey.Descriptor"/>. 19/// For a given <see cref="IKey.Descriptor"/>, any two instances returned by this method should 23IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key);
AuthenticatedEncryption\ManagedAuthenticatedEncryptorFactory.cs (1)
31public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
KeyManagement\DefaultKeyResolver.cs (11)
93private bool CanCreateAuthenticatedEncryptor(IKey key, ref int retriesRemaining) 107nameof(IKey.CreateEncryptor), 108new InvalidOperationException($"{nameof(IKey.CreateEncryptor)} returned null.")); 133_logger.KeyIsIneligibleToBeTheDefaultKeyBecauseItsMethodFailed(key.KeyId, nameof(IKey.CreateEncryptor), exceptions is null ? ex : new AggregateException(exceptions)); 137_logger.RetryingMethodOfKeyAfterFailure(key.KeyId, nameof(IKey.CreateEncryptor), ex); 148private IKey? FindDefaultKey(DateTimeOffset now, IEnumerable<IKey> allKeys, out IKey? fallbackKey) 161var preferredDefaultKey = (from key in allKeys 214public DefaultKeyResolution ResolveDefaultKeyPolicy(DateTimeOffset now, IEnumerable<IKey> allKeys) 217var defaultKey = FindDefaultKey(now, allKeys, out retVal.FallbackKey);
KeyManagement\IDeletableKeyManager.cs (1)
47bool DeleteKeys(Func<IKey, bool> shouldDelete);
KeyManagement\IKeyManager.cs (2)
26IKey CreateNewKey(DateTimeOffset activationDate, DateTimeOffset expirationDate); 32IReadOnlyCollection<IKey> GetAllKeys();
KeyManagement\Internal\CacheableKeyRing.cs (2)
18internal CacheableKeyRing(CancellationToken expirationToken, DateTimeOffset expirationTime, IKey defaultKey, IEnumerable<IKey> allKeys)
KeyManagement\Internal\DefaultKeyResolution.cs (4)
16/// If this property is non-null, its <see cref="IKey.CreateEncryptor()"/> method will succeed 19public IKey? DefaultKey; 27/// If this property is non-null, its <see cref="IKey.CreateEncryptor()"/> method will succeed 30public IKey? FallbackKey;
KeyManagement\Internal\IDefaultKeyResolver.cs (1)
17DefaultKeyResolution ResolveDefaultKeyPolicy(DateTimeOffset now, IEnumerable<IKey> allKeys);
KeyManagement\Internal\IInternalXmlKeyManager.cs (1)
21IKey CreateNewKey(Guid keyId, DateTimeOffset creationDate, DateTimeOffset activationDate, DateTimeOffset expirationDate);
KeyManagement\Key.cs (3)
16/// The basic implementation of <see cref="IKey"/>. 32/// The basic implementation of <see cref="IKey"/>, where the <see cref="IAuthenticatedEncryptorDescriptor"/> 54/// The basic implementation of <see cref="IKey"/>, where the incoming XML element
KeyManagement\KeyExtensions.cs (1)
10public static bool IsExpired(this IKey key, DateTimeOffset now)
KeyManagement\KeyRing.cs (5)
20public KeyRing(IKey defaultKey, IEnumerable<IKey> allKeys) 23foreach (IKey key in allKeys) 66private readonly IKey _key; 69internal KeyHolder(IKey key)
KeyManagement\KeyRingProvider.cs (8)
81private CacheableKeyRing CreateCacheableKeyRingCore(DateTimeOffset now, IKey? keyJustAdded) 89var defaultKey = defaultKeyPolicy.DefaultKey; 99var keyToUse = defaultKey ?? defaultKeyPolicy.FallbackKey ?? keyJustAdded; 138var keyToUse = defaultKey ?? defaultKeyPolicy.FallbackKey; 158var newKey = _keyManager.CreateNewKey(activationDate: now, expirationDate: now + _newKeyLifetime); 166var newKey = _keyManager.CreateNewKey(activationDate: defaultKey.ExpirationDate, expirationDate: now + _newKeyLifetime); 171private CacheableKeyRing CreateCacheableKeyRingCoreStep2(DateTimeOffset now, CancellationToken cacheExpirationToken, IKey defaultKey, IEnumerable<IKey> allKeys)
KeyManagement\XmlKeyManager.cs (6)
145public IKey CreateNewKey(DateTimeOffset activationDate, DateTimeOffset expirationDate) 164public IReadOnlyCollection<IKey> GetAllKeys() 168return processed.OfType<IKey>().ToList().AsReadOnly(); 414public bool DeleteKeys(Func<IKey, bool> shouldDelete) 443if (obj is IKey key) 504IKey IInternalXmlKeyManager.CreateNewKey(Guid keyId, DateTimeOffset creationDate, DateTimeOffset activationDate, DateTimeOffset expirationDate)