35 references to ValidationAlgorithm
Microsoft.AspNetCore.DataProtection (14)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (6)
151private static string GetBCryptAlgorithmNameFromValidationAlgorithm(ValidationAlgorithm algorithm) 155case ValidationAlgorithm.HMACSHA256: 158case ValidationAlgorithm.HMACSHA512: 185private static Type GetManagedTypeFromValidationAlgorithm(ValidationAlgorithm algorithm) 189case ValidationAlgorithm.HMACSHA256: 192case ValidationAlgorithm.HMACSHA512:
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorConfiguration.cs (3)
26/// The default value is <see cref="ValidationAlgorithm.HMACSHA256"/>. 29public ValidationAlgorithm ValidationAlgorithm { get; set; } = ValidationAlgorithm.HMACSHA256;
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializer.cs (2)
40configuration.ValidationAlgorithm = (ValidationAlgorithm)Enum.Parse(typeof(ValidationAlgorithm), (string)validationElement.Attribute("algorithm")!);
DataProtectionBuilderExtensions.cs (3)
437/// <see cref="ValidationAlgorithm"/> enumerations. 459/// <see cref="ValidationAlgorithm"/> enumerations. 481/// <see cref="ValidationAlgorithm"/> enumerations.
Microsoft.AspNetCore.DataProtection.Tests (21)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
22ValidationAlgorithm = ValidationAlgorithm.HMACSHA512
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (20)
23[InlineData(EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA256)] 24[InlineData(EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA256)] 25[InlineData(EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA256)] 26[InlineData(EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA512)] 27[InlineData(EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA512)] 28[InlineData(EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA512)] 29public void CreateAuthenticatedEncryptor_RoundTripsData_CngCbcImplementation(EncryptionAlgorithm encryptionAlgorithm, ValidationAlgorithm validationAlgorithm) 68var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm, ValidationAlgorithm.HMACSHA256 /* unused */, masterKey)); 94var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm, ValidationAlgorithm.HMACSHA256 /* unused */, masterKey)); 104public static TheoryData<EncryptionAlgorithm, ValidationAlgorithm, Func<HMAC>> CreateAuthenticatedEncryptor_RoundTripsData_ManagedImplementationData 107{ EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA256, () => new HMACSHA256() }, 108{ EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA256, () => new HMACSHA256() }, 109{ EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA256, () => new HMACSHA256() }, 110{ EncryptionAlgorithm.AES_128_CBC, ValidationAlgorithm.HMACSHA512, () => new HMACSHA512() }, 111{ EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA512, () => new HMACSHA512() }, 112{ EncryptionAlgorithm.AES_256_CBC, ValidationAlgorithm.HMACSHA512, () => new HMACSHA512() }, 119ValidationAlgorithm validationAlgorithm, 147var descriptor = CreateDescriptor(EncryptionAlgorithm.AES_192_CBC, ValidationAlgorithm.HMACSHA512, masterKey.ToSecret()); 170var descriptor = CreateDescriptor(EncryptionAlgorithm.AES_192_GCM, ValidationAlgorithm.HMACSHA512, masterKey.ToSecret()); 188private static AuthenticatedEncryptorDescriptor CreateDescriptor(EncryptionAlgorithm encryptionAlgorithm, ValidationAlgorithm validationAlgorithm, ISecret masterKey)