7 writes to HashAlgorithm
Microsoft.AspNetCore.DataProtection (3)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (1)
88
HashAlgorithm
= GetBCryptAlgorithmNameFromValidationAlgorithm(authenticatedConfiguration.ValidationAlgorithm)
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializer.cs (1)
41
configuration.
HashAlgorithm
= (string)hashElement.Attribute("algorithm")!;
RegistryPolicyResolver.cs (1)
138
options.
HashAlgorithm
= Convert.ToString(valueFromRegistry, CultureInfo.InvariantCulture)!;
Microsoft.AspNetCore.DataProtection.Tests (4)
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
28
HashAlgorithm
= Constants.BCRYPT_SHA512_ALGORITHM,
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorTests.cs (2)
20
HashAlgorithm
= "hash-alg",
49
HashAlgorithm
= "hash-alg"
RegistryPolicyResolverTests.cs (1)
130
HashAlgorithm
= "hash-alg",
13 references to HashAlgorithm
Microsoft.AspNetCore.DataProtection (9)
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (7)
70
if (String.IsNullOrEmpty(configuration.
HashAlgorithm
))
72
throw Error.Common_PropertyCannotBeNullOrEmpty(nameof(configuration.
HashAlgorithm
));
75
_logger.OpeningCNGAlgorithmFromProviderWithHMAC(configuration.
HashAlgorithm
, configuration.HashAlgorithmProvider);
81
if (configuration.
HashAlgorithm
== Constants.BCRYPT_SHA1_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.HMAC_SHA1; }
82
else if (configuration.
HashAlgorithm
== Constants.BCRYPT_SHA256_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.HMAC_SHA256; }
83
else if (configuration.
HashAlgorithm
== Constants.BCRYPT_SHA512_ALGORITHM) { algorithmHandle = CachedAlgorithmHandles.HMAC_SHA512; }
89
algorithmHandle = BCryptAlgorithmHandle.OpenAlgorithmHandle(configuration.
HashAlgorithm
, configuration.HashAlgorithmProvider, hmac: true);
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptor.cs (1)
55
new XAttribute("algorithm", Configuration.
HashAlgorithm
));
RegistryPolicyResolver.cs (1)
135
valueFromRegistry = key.GetValue(nameof(CngCbcAuthenticatedEncryptorConfiguration.
HashAlgorithm
));
Microsoft.AspNetCore.DataProtection.Tests (4)
RegistryPolicyResolverTests.cs (4)
107
Assert.Equal(expectedConfiguration.
HashAlgorithm
, actualConfiguration.
HashAlgorithm
);
143
Assert.Equal(expectedConfiguration.
HashAlgorithm
, actualConfiguration.
HashAlgorithm
);