35 references to ValidationAlgorithm
Microsoft.AspNetCore.DataProtection (14)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (6)
151
private static string GetBCryptAlgorithmNameFromValidationAlgorithm(
ValidationAlgorithm
algorithm)
155
case
ValidationAlgorithm
.HMACSHA256:
158
case
ValidationAlgorithm
.HMACSHA512:
185
private static Type GetManagedTypeFromValidationAlgorithm(
ValidationAlgorithm
algorithm)
189
case
ValidationAlgorithm
.HMACSHA256:
192
case
ValidationAlgorithm
.HMACSHA512:
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorConfiguration.cs (3)
26
/// The default value is <see cref="
ValidationAlgorithm
.HMACSHA256"/>.
29
public
ValidationAlgorithm
ValidationAlgorithm { get; set; } =
ValidationAlgorithm
.HMACSHA256;
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializer.cs (2)
40
configuration.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)
22
ValidationAlgorithm =
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)]
29
public void CreateAuthenticatedEncryptor_RoundTripsData_CngCbcImplementation(EncryptionAlgorithm encryptionAlgorithm,
ValidationAlgorithm
validationAlgorithm)
68
var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm,
ValidationAlgorithm
.HMACSHA256 /* unused */, masterKey));
94
var test = CreateEncryptorInstanceFromDescriptor(CreateDescriptor(encryptionAlgorithm,
ValidationAlgorithm
.HMACSHA256 /* unused */, masterKey));
104
public 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() },
119
ValidationAlgorithm
validationAlgorithm,
147
var descriptor = CreateDescriptor(EncryptionAlgorithm.AES_192_CBC,
ValidationAlgorithm
.HMACSHA512, masterKey.ToSecret());
170
var descriptor = CreateDescriptor(EncryptionAlgorithm.AES_192_GCM,
ValidationAlgorithm
.HMACSHA512, masterKey.ToSecret());
188
private static AuthenticatedEncryptorDescriptor CreateDescriptor(EncryptionAlgorithm encryptionAlgorithm,
ValidationAlgorithm
validationAlgorithm, ISecret masterKey)