1 implementation of IActivator
Microsoft.AspNetCore.DataProtection (1)
SimpleActivator.cs (1)
14internal class SimpleActivator : IActivator
48 references to IActivator
KeyManagementSimulator (1)
Program.cs (1)
267sealed class MockActivator(IXmlDecryptor decryptor, IAuthenticatedEncryptorDescriptorDeserializer descriptorDeserializer) : IActivator
Microsoft.AspNetCore.DataProtection (19)
ActivatorExtensions.cs (5)
14/// Extension methods for working with <see cref="IActivator"/>. 22public static T CreateInstance<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(this IActivator activator, string implementationTypeName) 32/// Returns a <see cref="IActivator"/> given an <see cref="IServiceProvider"/>. 35public static IActivator GetActivator(this IServiceProvider serviceProvider) 38? (serviceProvider.GetService<IActivator>() ?? new SimpleActivator(serviceProvider))
DataProtectionServiceCollectionExtensions.cs (1)
36services.TryAddSingleton<IActivator, TypeForwardingActivator>();
KeyManagement\XmlKeyManager.cs (7)
52private readonly IActivator _activator; 69/// <param name="activator">The <see cref="IActivator"/>.</param> 71public XmlKeyManager(IOptions<KeyManagementOptions> keyManagementOptions, IActivator activator) 80/// <param name="activator">The <see cref="IActivator"/>.</param> 83public XmlKeyManager(IOptions<KeyManagementOptions> keyManagementOptions, IActivator activator, ILoggerFactory loggerFactory) 90IActivator activator, 128IActivator activator,
RegistryPolicyResolver.cs (3)
26private readonly IActivator _activator; 28public RegistryPolicyResolver(IActivator activator) 34internal RegistryPolicyResolver(RegistryKey policyRegKey, IActivator activator)
SimpleActivator.cs (1)
11/// A simplified default implementation of <see cref="IActivator"/> that understands
XmlEncryption\XmlEncryptionExtensions.cs (2)
19public static XElement DecryptElement(this XElement element, IActivator activator) 70private static IXmlDecryptor CreateDecryptor(IActivator activator, string decryptorTypeName)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (1)
DataProtectionProviderTests.cs (1)
64s.GetRequiredService<IActivator>(),
Microsoft.AspNetCore.DataProtection.Tests (27)
ActivatorTests.cs (3)
71var expectedActivator = new Mock<IActivator>().Object; 73serviceCollection.AddSingleton<IActivator>(expectedActivator);
KeyManagement\XmlKeyManagerTests.cs (12)
325var activator = new Mock<IActivator>().Object; 363var mockActivator = new Mock<IActivator>(); 441var mockActivator = new Mock<IActivator>(); 478var mockActivator = new Mock<IActivator>(); 518var mockActivator = new Mock<IActivator>(); 548RunGetAllKeysCore(xml, new Mock<IActivator>().Object, loggerFactory).ToArray(); 572RunGetAllKeysCore(xml, new Mock<IActivator>().Object, loggerFactory).ToArray(); 592Assert.Throws<FormatException>(() => RunGetAllKeysCore(xml, new Mock<IActivator>().Object)); 595private static IReadOnlyCollection<IKey> RunGetAllKeysCore(string xml, IActivator activator, ILoggerFactory loggerFactory = null) 790var activator = new Mock<IActivator>(MockBehavior.Strict); 867var activator = new Mock<IActivator>(MockBehavior.Strict);
MockExtensions.cs (2)
18public static void ReturnDescriptorGivenDeserializerTypeNameAndInput(this Mock<IActivator> mockActivator, string typeName, string xml, IAuthenticatedEncryptorDescriptor descriptor) 41public static void ReturnDecryptedElementGivenDecryptorTypeNameAndInput(this Mock<IActivator> mockActivator, string typeName, string expectedInputXml, string outputXml)
XmlEncryption\XmlEncryptionExtensionsTests.cs (10)
37var mockActivator = new Mock<IActivator>(); 41serviceCollection.AddSingleton<IActivator>(mockActivator.Object); 63var mockActivator = new Mock<IActivator>(); 68serviceCollection.AddSingleton<IActivator>(mockActivator.Object); 95var mockActivator = new Mock<IActivator>(); 102serviceCollection.AddSingleton<IActivator>(mockActivator.Object); 127var mockActivator = new Mock<IActivator>(); 134serviceCollection.AddSingleton<IActivator>(mockActivator.Object); 181var mockActivator = new Mock<IActivator>(); 185serviceCollection.AddSingleton<IActivator>(mockActivator.Object);