1 interface inheriting from IAuthenticatedEncryptor
Microsoft.AspNetCore.DataProtection (1)
AuthenticatedEncryption\IOptimizedAuthenticatedEncryptor.cs (1)
11internal interface IOptimizedAuthenticatedEncryptor : IAuthenticatedEncryptor
2 implementations of IAuthenticatedEncryptor
KeyManagementSimulator (1)
Program.cs (1)
280sealed class MockAuthenticatedEncryptor : IAuthenticatedEncryptor
Microsoft.AspNetCore.DataProtection (1)
Managed\ManagedAuthenticatedEncryptor.cs (1)
16internal sealed unsafe class ManagedAuthenticatedEncryptor : IAuthenticatedEncryptor, IDisposable
101 references to IAuthenticatedEncryptor
KeyManagementSimulator (3)
Program.cs (3)
282byte[] IAuthenticatedEncryptor.Decrypt(ArraySegment<byte> ciphertext, ArraySegment<byte> _additionalAuthenticatedData) => ciphertext.ToArray(); 283byte[] IAuthenticatedEncryptor.Encrypt(ArraySegment<byte> plaintext, ArraySegment<byte> _additionalAuthenticatedData) => plaintext.ToArray(); 294IAuthenticatedEncryptor IAuthenticatedEncryptorFactory.CreateEncryptorInstance(IKey key)
Microsoft.AspNetCore.DataProtection (36)
AuthenticatedEncryption\AuthenticatedEncryptorExtensions.cs (2)
11public static byte[] Encrypt(this IAuthenticatedEncryptor encryptor, ArraySegment<byte> plaintext, ArraySegment<byte> additionalAuthenticatedData, uint preBufferSize, uint postBufferSize) 39public static void PerformSelfTest(this IAuthenticatedEncryptor encryptor)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (3)
19/// An <see cref="IAuthenticatedEncryptorFactory"/> to create an <see cref="IAuthenticatedEncryptor"/> 36public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key) 47internal IAuthenticatedEncryptor? CreateAuthenticatedEncryptorInstance(
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (1)
36public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (1)
36public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorConfiguration.cs (1)
48var encryptor = factory.CreateAuthenticatedEncryptorInstance(secret, this);
AuthenticatedEncryption\ConfigurationModel\IAuthenticatedEncryptorDescriptor.cs (1)
10/// material) necessary to create an instance of an <see cref="IAuthenticatedEncryptor"/>.
AuthenticatedEncryption\IAuthenticatedEncryptorFactory.cs (6)
10/// A factory to produce <see cref="IAuthenticatedEncryptor"/> instances. 15/// Creates an <see cref="IAuthenticatedEncryptor"/> instance based on the given <see cref="IKey.Descriptor"/>. 17/// <returns>An <see cref="IAuthenticatedEncryptor"/> instance.</returns> 20/// be considered equivalent, e.g., the payload returned by one's <see cref="IAuthenticatedEncryptor.Encrypt(ArraySegment{byte}, ArraySegment{byte})"/> 21/// method should be consumable by the other's <see cref="IAuthenticatedEncryptor.Decrypt(ArraySegment{byte}, ArraySegment{byte})"/> method. 23IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key);
AuthenticatedEncryption\ManagedAuthenticatedEncryptorFactory.cs (1)
31public IAuthenticatedEncryptor? CreateEncryptorInstance(IKey key)
EphemeralDataProtectionProvider.cs (3)
83public IAuthenticatedEncryptor? DefaultAuthenticatedEncryptor { get; } 87public IAuthenticatedEncryptor? GetAuthenticatedEncryptorByKeyId(Guid keyId, out bool isRevoked) 98private static IAuthenticatedEncryptor? GetDefaultEncryptor(ILoggerFactory loggerFactory)
KeyManagement\DefaultKeyResolver.cs (1)
100var encryptorInstance = key.CreateEncryptor();
KeyManagement\IKey.cs (3)
54/// Creates an <see cref="IAuthenticatedEncryptor"/> instance that can be used to encrypt data 57/// <returns>An <see cref="IAuthenticatedEncryptor"/>.</returns> 58IAuthenticatedEncryptor? CreateEncryptor();
KeyManagement\Internal\IKeyRing.cs (2)
20IAuthenticatedEncryptor? DefaultAuthenticatedEncryptor { get; } 34IAuthenticatedEncryptor? GetAuthenticatedEncryptorByKeyId(Guid keyId, out bool isRevoked);
KeyManagement\Key.cs (3)
29private IAuthenticatedEncryptor? _encryptor; 183public IAuthenticatedEncryptor? CreateEncryptor() 189var encryptor = factory.CreateEncryptorInstance(this);
KeyManagement\KeyManagementOptions.cs (1)
163/// <see cref="IAuthenticatedEncryptor"/>s.
KeyManagement\KeyRing.cs (5)
40public IAuthenticatedEncryptor? DefaultAuthenticatedEncryptor 56public IAuthenticatedEncryptor? GetAuthenticatedEncryptorByKeyId(Guid keyId, out bool isRevoked) 67private IAuthenticatedEncryptor? _encryptor; 74internal IAuthenticatedEncryptor? GetEncryptorInstance(out bool isRevoked) 78IAuthenticatedEncryptor? encryptor = Volatile.Read(ref _encryptor);
KeyManagement\KeyRingBasedDataProtector.cs (2)
98var defaultEncryptorInstance = currentKeyRing.DefaultAuthenticatedEncryptor; 229var requestedEncryptor = currentKeyRing.GetAuthenticatedEncryptorByKeyId(keyIdFromPayload, out keyWasRevoked);
Microsoft.AspNetCore.DataProtection.Tests (62)
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactoryTest.cs (2)
26var encryptor = factory.CreateEncryptorInstance(key.Object); 44var encryptor = factory.CreateEncryptorInstance(key.Object);
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactoryTest.cs (2)
26var encryptor = factory.CreateEncryptorInstance(key.Object); 44var encryptor = factory.CreateEncryptorInstance(key.Object);
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializerTests.cs (3)
25var control = CreateEncryptorInstanceFromDescriptor(descriptor); 34var test = CreateEncryptorInstanceFromDescriptor(deserializedDescriptor as AuthenticatedEncryptorDescriptor); 44private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(AuthenticatedEncryptorDescriptor descriptor)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (5)
42var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm, validationAlgorithm, masterKey)); 68var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm, ValidationAlgorithm.HMACSHA256 /* unused */, masterKey)); 94var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm, ValidationAlgorithm.HMACSHA256 /* unused */, masterKey)); 132var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm, validationAlgorithm, masterKey)); 197private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(AuthenticatedEncryptorDescriptor descriptor)
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs (3)
32var control = CreateEncryptorInstanceFromDescriptor(descriptor); 41var test = CreateEncryptorInstanceFromDescriptor(deserializedDescriptor as CngCbcAuthenticatedEncryptorDescriptor); 51private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(CngCbcAuthenticatedEncryptorDescriptor descriptor)
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs (3)
30var control = CreateEncryptorInstanceFromDescriptor(descriptor); 38var test = CreateEncryptorInstanceFromDescriptor(deserializedDescriptor as CngGcmAuthenticatedEncryptorDescriptor); 48private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(CngGcmAuthenticatedEncryptorDescriptor descriptor)
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializerTests.cs (5)
31var control = CreateEncryptorInstanceFromDescriptor(descriptor); 42var test = CreateEncryptorInstanceFromDescriptor(deserializedDescriptor as ManagedAuthenticatedEncryptorDescriptor); 65var control = CreateEncryptorInstanceFromDescriptor(descriptor); 76var test = CreateEncryptorInstanceFromDescriptor(deserializedDescriptor as ManagedAuthenticatedEncryptorDescriptor); 149private static IAuthenticatedEncryptor CreateEncryptorInstanceFromDescriptor(ManagedAuthenticatedEncryptorDescriptor descriptor)
AuthenticatedEncryption\ManagedAuthenticatedEncryptorFactoryTest.cs (2)
24var encryptor = factory.CreateEncryptorInstance(key.Object); 41var encryptor = factory.CreateEncryptorInstance(key.Object);
KeyManagement\DefaultKeyResolverTests.cs (3)
339var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 409var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 472mockKey.Setup(o => o.CreateEncryptor()).Returns(Mock.Of<IAuthenticatedEncryptor>());
KeyManagement\KeyRingBasedDataProtectorTests.cs (12)
43var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 81var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 204mockEncryptorFactory.Setup(o => o.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 232mockEncryptorFactory.Setup(m => m.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 257mockEncryptorFactory.Setup(o => o.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 288mockEncryptorFactory.Setup(o => o.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 324mockEncryptorFactory.Setup(o => o.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 391mockEncryptorFactory.Setup(o => o.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 421var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 468var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 517var mockEncryptor = new Mock<IAuthenticatedEncryptor>(); 592var mockEncryptor = new Mock<IAuthenticatedEncryptor>();
KeyManagement\KeyRingProviderTests.cs (3)
881mockEncryptorFactory.Setup(m => m.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 898mockEncryptorFactory.Setup(m => m.CreateEncryptorInstance(It.IsAny<IKey>())).Returns(new Mock<IAuthenticatedEncryptor>().Object); 944mockKey.Setup(o => o.CreateEncryptor()).Returns(new Mock<IAuthenticatedEncryptor>().Object);
KeyManagement\KeyRingTests.cs (11)
16var expectedEncryptorInstance = new Mock<IAuthenticatedEncryptor>().Object; 52var key3 = new MyKey(expectedEncryptorInstance: new Mock<IAuthenticatedEncryptor>().Object); 66var expectedEncryptorInstance1 = new Mock<IAuthenticatedEncryptor>().Object; 67var expectedEncryptorInstance2 = new Mock<IAuthenticatedEncryptor>().Object; 97private readonly Func<IAuthenticatedEncryptor> _encryptorFactory; 99public MyKey(bool isRevoked = false, IAuthenticatedEncryptor expectedEncryptorInstance = null) 106_encryptorFactory = () => expectedEncryptorInstance ?? new Mock<IAuthenticatedEncryptor>().Object; 116public IAuthenticatedEncryptor CreateEncryptor()
KeyManagement\XmlKeyManagerTests.cs (8)
86var expectedAuthenticatedEncryptor = new Mock<IAuthenticatedEncryptor>().Object; 175var expectedAuthenticatedEncryptor = new Mock<IAuthenticatedEncryptor>().Object; 1033private IAuthenticatedEncryptor _expectedEncryptor; 1035public TestEncryptorFactory(IAuthenticatedEncryptorDescriptor associatedDescriptor = null, IAuthenticatedEncryptor expectedEncryptor = null) 1041public IAuthenticatedEncryptor CreateEncryptorInstance(IKey key) 1048return _expectedEncryptor ?? new Mock<IAuthenticatedEncryptor>().Object;