15 instantiations of HashAlgorithmName
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\CompilationAPITests.cs (1)
404pdbChecksumAlgorithm: new HashAlgorithmName("invalid hash algorithm name"));
Microsoft.CodeAnalysis.UnitTests (1)
Emit\EmitOptionsTests.cs (1)
60TestProperty((old, value) => old.WithPdbChecksumAlgorithm(value), opt => opt.PdbChecksumAlgorithm, new HashAlgorithmName());
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\CompilationAPITests.vb (2)
500pdbChecksumAlgorithm:=New HashAlgorithmName("invalid hash algorithm name")) 516Dim options = New EmitOptions(pdbChecksumAlgorithm:=New HashAlgorithmName())
System.Security.Cryptography (11)
System\Security\Cryptography\HashAlgorithmName.cs (8)
33public static HashAlgorithmName MD5 { get { return new HashAlgorithmName("MD5"); } } 38public static HashAlgorithmName SHA1 { get { return new HashAlgorithmName("SHA1"); } } 43public static HashAlgorithmName SHA256 { get { return new HashAlgorithmName("SHA256"); } } 48public static HashAlgorithmName SHA384 { get { return new HashAlgorithmName("SHA384"); } } 53public static HashAlgorithmName SHA512 { get { return new HashAlgorithmName("SHA512"); } } 58public static HashAlgorithmName SHA3_256 => new HashAlgorithmName("SHA3-256"); 63public static HashAlgorithmName SHA3_384 => new HashAlgorithmName("SHA3-384"); 68public static HashAlgorithmName SHA3_512 => new HashAlgorithmName("SHA3-512");
System\Security\Cryptography\IncrementalHash.cs (1)
43_algorithmName = new HashAlgorithmName("HMAC" + name.Name);
System\Security\Cryptography\RSAPKCS1SignatureDeformatter.cs (1)
55return _rsaKey.VerifyHash(rgbHash, rgbSignature, new HashAlgorithmName(_algName), RSASignaturePadding.Pkcs1);
System\Security\Cryptography\RSAPKCS1SignatureFormatter.cs (1)
55return _rsaKey.SignHash(rgbHash, new HashAlgorithmName(_algName), RSASignaturePadding.Pkcs1);
866 references to HashAlgorithmName
Aspire.Dashboard (1)
DashboardWebApplication.cs (1)
663certThumbprint ??= context.ClientCertificate.GetCertHashString(HashAlgorithmName.SHA256);
dotnet-dev-certs (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
HttpStress (1)
Program.cs (1)
398var certReq = new CertificateRequest($"CN={LocalhostName}", rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
31parentKey, HashAlgorithmName.SHA256,
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
31parentKey, HashAlgorithmName.SHA256,
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
31parentKey, HashAlgorithmName.SHA256,
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
31parentKey, HashAlgorithmName.SHA256,
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
31parentKey, HashAlgorithmName.SHA256,
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
31parentKey, HashAlgorithmName.SHA256,
InMemory.FunctionalTests (6)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (6)
210var req = new CertificateRequest(subjectName, _cert.PublicKey, HashAlgorithmName.SHA256); 262HashAlgorithmName.SHA256, 347HashAlgorithmName.SHA256, 481key.SignData(tbsCertList, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); 634HashAlgorithmName.SHA256, 823HashAlgorithmName.SHA256,
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateValidationCache.cs (1)
66=> certificate.GetCertHashString(HashAlgorithmName.SHA256);
Microsoft.AspNetCore.Authentication.Test (1)
src\Shared\test\Certificates\Certificates.cs (1)
85HashAlgorithmName.SHA256,
Microsoft.AspNetCore.Components.Endpoints (1)
Builder\ResourceCollectionUrlEndpoint.cs (1)
113var incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.SHA256);
Microsoft.AspNetCore.Cryptography.KeyDerivation (4)
PBKDF2\NetCorePbkdf2Provider.cs (4)
24HashAlgorithmName algorithmName; 28algorithmName = HashAlgorithmName.SHA1; 31algorithmName = HashAlgorithmName.SHA256; 34algorithmName = HashAlgorithmName.SHA512;
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (1)
CertificateManagerTests.cs (1)
304var csr = new CertificateRequest(httpsCertificate.Subject + "Not", privateKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.HttpOverrides.Tests (1)
src\Shared\test\Certificates\Certificates.cs (1)
85HashAlgorithmName.SHA256,
Microsoft.AspNetCore.Server.Kestrel.Core (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (6)
210var req = new CertificateRequest(subjectName, _cert.PublicKey, HashAlgorithmName.SHA256); 262HashAlgorithmName.SHA256, 347HashAlgorithmName.SHA256, 481key.SignData(tbsCertList, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); 634HashAlgorithmName.SHA256, 823HashAlgorithmName.SHA256,
Microsoft.AspNetCore.Testing (1)
FakeSslCertificateFactory.cs (1)
28HashAlgorithmName.SHA256,
Microsoft.CodeAnalysis (17)
CryptographicHashProvider.cs (7)
96internal static HashAlgorithmName GetAlgorithmName(SourceHashAlgorithm algorithmId) 102return HashAlgorithmName.SHA1; 105return HashAlgorithmName.SHA256; 198internal static ImmutableArray<byte> ComputeHash(HashAlgorithmName algorithmName, IEnumerable<Blob> bytes) 207internal static ImmutableArray<byte> ComputeHash(HashAlgorithmName algorithmName, IEnumerable<ArraySegment<byte>> bytes) 218var algorithmName = GetAlgorithmName(hashAlgorithm); 230var algorithmName = GetAlgorithmName(hashAlgorithm);
Emit\CommonPEModuleBuilder.cs (1)
71internal HashAlgorithmName PdbChecksumAlgorithm => EmitOptions.PdbChecksumAlgorithm;
Emit\EmitOptions.cs (5)
99public HashAlgorithmName PdbChecksumAlgorithm { get; private set; } 197HashAlgorithmName? pdbChecksumAlgorithm) 230HashAlgorithmName? pdbChecksumAlgorithm = null, 246PdbChecksumAlgorithm = pdbChecksumAlgorithm ?? HashAlgorithmName.SHA256; 420public EmitOptions WithPdbChecksumAlgorithm(HashAlgorithmName name)
NativePdbWriter\PdbWriter.cs (2)
30private readonly HashAlgorithmName _hashAlgorithmNameOpt; 44public PdbWriter(string fileName, Func<ISymWriterMetadataProvider, SymUnmanagedWriter> symWriterFactory, HashAlgorithmName hashAlgorithmNameOpt)
PEWriter\SigningUtilities.cs (2)
28var signature = rsa.SignHash(hash, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); 36using (var hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1))
Microsoft.CodeAnalysis.CSharp (1)
CommandLine\CSharpCommandLineParser.cs (1)
1528pdbChecksumAlgorithm: HashAlgorithmName.SHA256,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTests.cs (3)
5823Assert.Equal(HashAlgorithmName.SHA256, parsedArgs.EmitOptions.PdbChecksumAlgorithm); 5828Assert.Equal(HashAlgorithmName.SHA256, parsedArgs.EmitOptions.PdbChecksumAlgorithm); 5834Assert.Equal(HashAlgorithmName.SHA256, parsedArgs.EmitOptions.PdbChecksumAlgorithm);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\DeterministicTests.cs (1)
490.WithPdbChecksumAlgorithm(HashAlgorithmName.SHA256);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\PortablePdbTests.cs (2)
171WithPdbChecksumAlgorithm(HashAlgorithmName.SHA512)); 230WithPdbChecksumAlgorithm(HashAlgorithmName.SHA384).
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\CompilationAPITests.cs (1)
426var options = new EmitOptions(pdbChecksumAlgorithm: default(HashAlgorithmName));
Microsoft.CodeAnalysis.Scripting (1)
ScriptBuilder.cs (1)
53pdbChecksumAlgorithm: default(HashAlgorithmName));
Microsoft.CodeAnalysis.Test.Utilities (3)
Metadata\ILValidation.cs (2)
110if (!rsa.VerifyHash(hash, reversedSignature, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1)) 150using (var hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1))
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
38pdbChecksumAlgorithm: HashAlgorithmName.SHA256,
Microsoft.CodeAnalysis.UnitTests (3)
Emit\EmitOptionsTests.cs (3)
61TestProperty((old, value) => old.WithPdbChecksumAlgorithm(value), opt => opt.PdbChecksumAlgorithm, HashAlgorithmName.SHA384); 141pdbChecksumAlgorithm: HashAlgorithmName.MD5); // CodeQL [SM02196] This is testing an algorithm that our codebase must support for PDBs 144Assert.Equal(options2, options3.WithPdbChecksumAlgorithm(HashAlgorithmName.SHA256));
Microsoft.CodeAnalysis.VisualBasic (1)
CommandLine\VisualBasicCommandLineParser.vb (1)
1463pdbChecksumAlgorithm:=HashAlgorithmName.SHA256) ' TODO: set from /checksumalgorithm (see https://github.com/dotnet/roslyn/issues/24735)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
CommandLineTests.vb (3)
1910Assert.Equal(HashAlgorithmName.SHA256, parsedArgs.EmitOptions.PdbChecksumAlgorithm) 1915Assert.Equal(HashAlgorithmName.SHA256, parsedArgs.EmitOptions.PdbChecksumAlgorithm) 1920Assert.Equal(HashAlgorithmName.SHA256, parsedArgs.EmitOptions.PdbChecksumAlgorithm)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (2)
PDB\PortablePdbTests.vb (2)
81WithPdbChecksumAlgorithm(HashAlgorithmName.SHA512)) 133WithPdbChecksumAlgorithm(HashAlgorithmName.SHA384).
Microsoft.DotNet.Build.Tasks.Workloads (3)
Msi\MsiBase.wix.cs (1)
96protected string OutputName => $"{Utils.GetTruncatedHash(BaseOutputName, HashAlgorithmName.SHA256)}-{Platform}.msi";
Swix\MsiSwixProject.wix.cs (1)
90ProjectFile = $"{Utils.GetTruncatedHash(hashInputs, HashAlgorithmName.SHA256)}.swixproj";
Utils.cs (1)
22public static string GetTruncatedHash(string value, HashAlgorithmName hashName)
Microsoft.DotNet.SignCheckLibrary (3)
Verification\ArchiveVerifier.cs (3)
40string hashedPath = String.IsNullOrEmpty(directoryName) ? Utils.GetHash(@".\", HashAlgorithmName.SHA256.Name) : 41Utils.GetHash(directoryName, HashAlgorithmName.SHA256.Name); 46Utils.GetHash(archiveEntry.FullName, HashAlgorithmName.SHA256.Name) + Path.GetExtension(archiveEntry.FullName); // lgtm [cs/zipslip] Archive from trusted source
Microsoft.DotNet.SignTool (3)
src\StrongName.cs (3)
183if (!rsa.VerifyHash(hash, reversedSignature, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1)) 379signature = snkRSA.SignHash(hash, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); 469using (var hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1))
Microsoft.Extensions.FileProviders.Physical (1)
PollingWildCardChangeToken.cs (1)
118using (var sha256 = IncrementalHash.CreateHash(HashAlgorithmName.SHA256))
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
883[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HashAlgorithmName))]
netstandard (1)
netstandard.cs (1)
1880[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HashAlgorithmName))]
Roslyn.Test.PdbUtilities (1)
Reader\PdbValidation.cs (1)
563public static void ValidateDebugDirectory(Stream peStream, Stream portablePdbStreamOpt, string pdbPath, HashAlgorithmName hashAlgorithm, bool hasEmbeddedPdb, bool isDeterministic)
System.Net.Security (6)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
166var key = new SslContextCacheKey(protocols, sslAuthenticationOptions.CertificateContext?.TargetCertificate.GetCertHash(HashAlgorithmName.SHA256));
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (5)
417using (var hmac = IncrementalHash.CreateHMAC(HashAlgorithmName.MD5, ntlm2hash)) 443using (var md5 = IncrementalHash.CreateHash(HashAlgorithmName.MD5)) 554using (var md5 = IncrementalHash.CreateHash(HashAlgorithmName.MD5)) 679using (var hmacMic = IncrementalHash.CreateHMAC(HashAlgorithmName.MD5, exportedSessionKey)) 722using (var hmac = IncrementalHash.CreateHMAC(HashAlgorithmName.MD5, signingKey))
System.Security.Cryptography (595)
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (9)
204internal static string GetOidFromHashAlgorithm(HashAlgorithmName algName) 206if (algName == HashAlgorithmName.MD5) 208if (algName == HashAlgorithmName.SHA1) 210if (algName == HashAlgorithmName.SHA256) 212if (algName == HashAlgorithmName.SHA384) 214if (algName == HashAlgorithmName.SHA512) 217if (algName == HashAlgorithmName.SHA3_256) 219if (algName == HashAlgorithmName.SHA3_384) 221if (algName == HashAlgorithmName.SHA3_512)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.DigestAlgs.cs (1)
151case nameof(HashAlgorithmName.MD5): return EvpMd5();
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Rsa.cs (2)
136HashAlgorithmName digestAlgorithm, 177HashAlgorithmName digestAlgorithm,
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (6)
21HashAlgorithmName hashAlgorithm; 30hashAlgorithm = HashAlgorithmName.MD5; 34hashAlgorithm = HashAlgorithmName.SHA1; 38hashAlgorithm = HashAlgorithmName.SHA256; 42hashAlgorithm = HashAlgorithmName.SHA384; 46hashAlgorithm = HashAlgorithmName.SHA512;
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (5)
18HashAlgorithmName hashAlgorithm, 42HashAlgorithmName hashAlgorithm, 144HashAlgorithmName.MD5, 155HashAlgorithmName.SHA1, 177HashAlgorithmName algorithmName,
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.Derive.cs (3)
15DeriveKeyFromHash(otherPartyPublicKey, HashAlgorithmName.SHA256, null, null); 19HashAlgorithmName hashAlgorithm, 38HashAlgorithmName hashAlgorithm,
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (25)
44if (pbeParameters.HashAlgorithm != HashAlgorithmName.SHA1) 88HashAlgorithmName digestAlgorithmName; 96digestAlgorithmName = HashAlgorithmName.MD5; 100digestAlgorithmName = HashAlgorithmName.MD5; 104digestAlgorithmName = HashAlgorithmName.SHA1; 108digestAlgorithmName = HashAlgorithmName.SHA1; 112digestAlgorithmName = HashAlgorithmName.SHA1; 117digestAlgorithmName = HashAlgorithmName.SHA1; 123digestAlgorithmName = HashAlgorithmName.SHA1; 129digestAlgorithmName = HashAlgorithmName.SHA1; 280HashAlgorithmName prf = pbeParameters.HashAlgorithm; 282if (prf == HashAlgorithmName.SHA256) 286else if (prf == HashAlgorithmName.SHA384) 290else if (prf == HashAlgorithmName.SHA512) 294else if (prf == HashAlgorithmName.SHA1) 328HashAlgorithmName prf = pbeParameters.HashAlgorithm; 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 748HashAlgorithmName prf = pbkdf2Params.Prf.Algorithm switch 750Oids.HmacWithSha1 => HashAlgorithmName.SHA1, 751Oids.HmacWithSha256 => HashAlgorithmName.SHA256, 752Oids.HmacWithSha384 => HashAlgorithmName.SHA384, 753Oids.HmacWithSha512 => HashAlgorithmName.SHA512, 858HashAlgorithmName hashAlgorithm, 1116HashAlgorithmName prf, 1133HashAlgorithmName prf)
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (2)
153HashAlgorithmName hashAlgorithm, 165HashAlgorithmName hashAlgorithm,
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (11)
20private static readonly (HashAlgorithmName, int, int)[] s_uvLookup = new[] 22(HashAlgorithmName.MD5, 128, 512), 23(HashAlgorithmName.SHA1, 160, 512), 24(HashAlgorithmName.SHA256, 256, 512), 25(HashAlgorithmName.SHA384, 384, 1024), 26(HashAlgorithmName.SHA512, 512, 1024), 31HashAlgorithmName hashAlgorithm, 47HashAlgorithmName hashAlgorithm, 63HashAlgorithmName hashAlgorithm, 79HashAlgorithmName hashAlgorithm, 89foreach ((HashAlgorithmName, int, int) huv in s_uvLookup)
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (4)
727public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 752HashAlgorithmName hashAlgorithm, 777HashAlgorithmName hashAlgorithm, 786public override bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (6)
72HashAlgorithmName hashAlgorithmName, 112internal static int HashLength(HashAlgorithmName hashAlgorithmName) 250HashAlgorithmName hashAlgorithmName, 289HashAlgorithmName hashAlgorithmName, 383internal static void EncodePss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> mHash, Span<byte> destination, int keySize) 472internal static bool VerifyPss(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> mHash, ReadOnlySpan<byte> em, int keySize)
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdf.cs (29)
42HashAlgorithmName hashAlgorithm); 50/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 53/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 61public SP800108HmacCounterKdf(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm) 74/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 82/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 90public SP800108HmacCounterKdf(byte[] key, HashAlgorithmName hashAlgorithm) 125/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 129/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 141public static byte[] DeriveBytes(byte[] key, HashAlgorithmName hashAlgorithm, byte[] label, byte[] context, int derivedKeyLengthInBytes) 183/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 187/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 207public static byte[] DeriveBytes(byte[] key, HashAlgorithmName hashAlgorithm, string label, string context, int derivedKeyLengthInBytes) 236/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 239/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 251public static byte[] DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, int derivedKeyLengthInBytes) 269/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 272/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 283public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> label, ReadOnlySpan<byte> context, Span<byte> destination) 300/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 303/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 323public static byte[] DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, int derivedKeyLengthInBytes) 341/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's <see langword="null" />. 344/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> that's empty. 363public static void DeriveBytes(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> label, ReadOnlySpan<char> context, Span<byte> destination) 547private static void CheckHashAlgorithm(HashAlgorithmName hashAlgorithm) 589HashAlgorithmName hashAlgorithm, 596HashAlgorithmName hashAlgorithm, 603HashAlgorithmName hashAlgorithm,
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (1)
18private readonly HashAlgorithmName _hashAlgorithm;
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (2)
924HashAlgorithmName hashAlgorithm = HashAlgorithmName.SHA1;
System\Security\Cryptography\CapiHelper.Unix.cs (21)
9internal static HashAlgorithmName ObjToHashAlgorithmName(object hashAlg) 22internal static HashAlgorithmName NameOrOidToHashAlgorithmName(string? nameOrOid) 27return HashAlgorithmName.SHA1; 38private static HashAlgorithmName AlgorithmToHashAlgorithmName(HashAlgorithm hashAlgorithm) 43SHA256 => HashAlgorithmName.SHA256, 44SHA1 => HashAlgorithmName.SHA1, 45SHA384 => HashAlgorithmName.SHA384, 46SHA512 => HashAlgorithmName.SHA512, 47MD5 => HashAlgorithmName.MD5, 52private static HashAlgorithmName OidToHashAlgorithmName(string oid) 57Oids.Sha256 => HashAlgorithmName.SHA256, 58Oids.Sha1 => HashAlgorithmName.SHA1, 59Oids.Sha384 => HashAlgorithmName.SHA384, 60Oids.Sha512 => HashAlgorithmName.SHA512, 61Oids.Md5 => HashAlgorithmName.MD5, 66private static HashAlgorithmName HashAlgorithmTypeToHashAlgorithmName(Type hashAlgType) 70return HashAlgorithmName.SHA1; 72return HashAlgorithmName.SHA256; 74return HashAlgorithmName.SHA384; 76return HashAlgorithmName.SHA512; 78return HashAlgorithmName.MD5;
System\Security\Cryptography\CryptographicOperations.cs (55)
78/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 83/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty. 91public static byte[] HashData(HashAlgorithmName hashAlgorithm, byte[] source) 104/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 108/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty. 116public static byte[] HashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source) 137/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 140/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 149public static int HashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination) 173/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty. 176/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 185public static bool TryHashData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten) 211/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 216/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 226public static byte[] HashData(HashAlgorithmName hashAlgorithm, Stream source) 245/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 252/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 262public static int HashData(HashAlgorithmName hashAlgorithm, Stream source, Span<byte> destination) 288/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 295/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 309HashAlgorithmName hashAlgorithm, 339/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 344/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 358HashAlgorithmName hashAlgorithm, 380/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 385/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty. 393public static byte[] HmacData(HashAlgorithmName hashAlgorithm, byte[] key, byte[] source) 408/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 412/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty. 420public static byte[] HmacData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, ReadOnlySpan<byte> source) 442/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 445/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 455HashAlgorithmName hashAlgorithm, 483/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty. 486/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 496HashAlgorithmName hashAlgorithm, 527/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 532/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 542public static byte[] HmacData(HashAlgorithmName hashAlgorithm, byte[] key, Stream source) 559/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 564/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 574public static byte[] HmacData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, Stream source) 595/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 600/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 612public static int HmacData(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key, Stream source, Span<byte> destination) 636/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 641/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 655HashAlgorithmName hashAlgorithm, 679/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 686/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 700HashAlgorithmName hashAlgorithm, 728/// <paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is 733/// <para><paramref name="hashAlgorithm"/> has a <see cref="HashAlgorithmName.Name" /> that is empty.</para> 747HashAlgorithmName hashAlgorithm, 771private static int CheckHashAndGetLength(HashAlgorithmName hashAlgorithm)
System\Security\Cryptography\DSA.cs (33)
89protected virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 92protected virtual byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) => 95public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) 120/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 125public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 136public virtual byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) 183/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 192HashAlgorithmName hashAlgorithm, 224HashAlgorithmName hashAlgorithm, 241public virtual byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm) 266/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 271public byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 293protected virtual byte[] SignDataCore(Stream data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 299public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm) 306public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm) 355/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 365HashAlgorithmName hashAlgorithm, 384public virtual bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm) 522HashAlgorithmName hashAlgorithm, 540HashAlgorithmName hashAlgorithm, 575/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 583HashAlgorithmName hashAlgorithm, 616HashAlgorithmName hashAlgorithm, 629HashAlgorithmName hashAlgorithm) 653/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 661HashAlgorithmName hashAlgorithm, 690/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 698HashAlgorithmName hashAlgorithm, 726HashAlgorithmName hashAlgorithm, 752HashAlgorithmName hashAlgorithm, 778HashAlgorithmName hashAlgorithm, 880HashAlgorithmName hashAlgorithm, 895private byte[] HashSpanToArray(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm)
System\Security\Cryptography\DSACryptoServiceProvider.Unix.cs (22)
101protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) 103if (hashAlgorithm != HashAlgorithmName.SHA1) 109protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) 111if (hashAlgorithm != HashAlgorithmName.SHA1) 117protected override bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 119if (hashAlgorithm != HashAlgorithmName.SHA1) 187return _impl.SignData(buffer, HashAlgorithmName.SHA1); 192return _impl.SignData(buffer, offset, count, HashAlgorithmName.SHA1); 197return _impl.SignData(inputStream, HashAlgorithmName.SHA1); 203public override byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) 205if (hashAlgorithm != HashAlgorithmName.SHA1) 211public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm) 213if (hashAlgorithm != HashAlgorithmName.SHA1) 219public override bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 221if (hashAlgorithm != HashAlgorithmName.SHA1) 245_impl.VerifyData(rgbData, rgbSignature, HashAlgorithmName.SHA1); 261public override bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm) 263if (hashAlgorithm != HashAlgorithmName.SHA1) 269public override bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm) 271if (hashAlgorithm != HashAlgorithmName.SHA1) 277public override bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm) 279if (hashAlgorithm != HashAlgorithmName.SHA1)
System\Security\Cryptography\DSAWrapper.cs (8)
32public override byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 35public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm) => 43HashAlgorithmName hashAlgorithm) => 46public override bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm) => 55HashAlgorithmName hashAlgorithm, 62HashAlgorithmName hashAlgorithm) => 159protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 162protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) =>
System\Security\Cryptography\ECCurve.cs (1)
57public HashAlgorithmName? Hash;
System\Security\Cryptography\ECDiffieHellman.cs (4)
58public byte[] DeriveKeyFromHash(ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm) 75HashAlgorithmName hashAlgorithm, 93HashAlgorithmName hashAlgorithm, 112HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (2)
30HashAlgorithmName hashAlgorithm, 37HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\ECDsa.cs (51)
41public virtual byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) 50public virtual byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) 97/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 106HashAlgorithmName hashAlgorithm, 138HashAlgorithmName hashAlgorithm, 196/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 201public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 227/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 232public byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 256HashAlgorithmName hashAlgorithm, 465HashAlgorithmName hashAlgorithm, 495/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 503HashAlgorithmName hashAlgorithm, 536HashAlgorithmName hashAlgorithm, 546public virtual byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm) 568/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 571/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 576/// <see cref="SignData(ReadOnlySpan{byte}, HashAlgorithmName, DSASignatureFormat)" />. 578/// <seealso cref="SignData(ReadOnlySpan{byte}, HashAlgorithmName, DSASignatureFormat)" /> 579public byte[] SignData(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm) 602/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 605/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 610/// <seealso cref="SignData(ReadOnlySpan{byte}, HashAlgorithmName)" /> 611public byte[] SignData(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 641/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 649/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 654/// <seealso cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName)" /> 658HashAlgorithmName hashAlgorithm, 691/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 699/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 704/// <see cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName, DSASignatureFormat)" />. 706/// <seealso cref="SignData(ReadOnlySpan{byte}, Span{byte}, HashAlgorithmName, DSASignatureFormat)" /> 707public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm) 719public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm) 726public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm) 775/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 785HashAlgorithmName hashAlgorithm, 825/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 830public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) 841public virtual bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm) 869HashAlgorithmName hashAlgorithm, 895HashAlgorithmName hashAlgorithm, 915public bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm) 942/// <paramref name="hashAlgorithm"/> has a <see langword="null"/> or empty <see cref="HashAlgorithmName.Name"/>. 950HashAlgorithmName hashAlgorithm, 979HashAlgorithmName hashAlgorithm, 992protected virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 995protected virtual byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) => 998protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 1200HashAlgorithmName hashAlgorithm, 1215private byte[] HashSpanToArray(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm)
System\Security\Cryptography\ECDsaWrapper.cs (8)
20public override byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) => 23public override byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 29HashAlgorithmName hashAlgorithm, 33public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm) => 41HashAlgorithmName hashAlgorithm) => 47HashAlgorithmName hashAlgorithm) => 184protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 187protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) =>
System\Security\Cryptography\HashAlgorithmName.cs (28)
25public readonly struct HashAlgorithmName : IEquatable<HashAlgorithmName> 31/// Gets a <see cref="HashAlgorithmName" /> representing "MD5" 33public static HashAlgorithmName MD5 { get { return new HashAlgorithmName("MD5"); } } 36/// Gets a <see cref="HashAlgorithmName" /> representing "SHA1" 38public static HashAlgorithmName SHA1 { get { return new HashAlgorithmName("SHA1"); } } 41/// Gets a <see cref="HashAlgorithmName" /> representing "SHA256" 43public static HashAlgorithmName SHA256 { get { return new HashAlgorithmName("SHA256"); } } 46/// Gets a <see cref="HashAlgorithmName" /> representing "SHA384" 48public static HashAlgorithmName SHA384 { get { return new HashAlgorithmName("SHA384"); } } 51/// Gets a <see cref="HashAlgorithmName" /> representing "SHA512" 53public static HashAlgorithmName SHA512 { get { return new HashAlgorithmName("SHA512"); } } 56/// Gets a <see cref="HashAlgorithmName" /> representing "SHA3-256" 58public static HashAlgorithmName SHA3_256 => new HashAlgorithmName("SHA3-256"); 61/// Gets a <see cref="HashAlgorithmName" /> representing "SHA3-384" 63public static HashAlgorithmName SHA3_384 => new HashAlgorithmName("SHA3-384"); 66/// Gets a <see cref="HashAlgorithmName" /> representing "SHA3-512" 68public static HashAlgorithmName SHA3_512 => new HashAlgorithmName("SHA3-512"); 73/// Gets a <see cref="HashAlgorithmName" /> representing a custom name. 100return obj is HashAlgorithmName && Equals((HashAlgorithmName)obj); 103public bool Equals(HashAlgorithmName other) 114public static bool operator ==(HashAlgorithmName left, HashAlgorithmName right) 119public static bool operator !=(HashAlgorithmName left, HashAlgorithmName right) 139public static bool TryFromOid(string oidValue, out HashAlgorithmName value) 188public static HashAlgorithmName FromOid(string oidValue) 190if (TryFromOid(oidValue, out HashAlgorithmName value))
System\Security\Cryptography\Helpers.cs (9)
351internal static int HashLength(HashAlgorithmName hashAlgorithmName) 353if (hashAlgorithmName == HashAlgorithmName.SHA1) 357else if (hashAlgorithmName == HashAlgorithmName.SHA256) 361else if (hashAlgorithmName == HashAlgorithmName.SHA384) 365else if (hashAlgorithmName == HashAlgorithmName.SHA512) 369else if (hashAlgorithmName == HashAlgorithmName.SHA3_256) 373else if (hashAlgorithmName == HashAlgorithmName.SHA3_384) 377else if (hashAlgorithmName == HashAlgorithmName.SHA3_512) 381else if (hashAlgorithmName == HashAlgorithmName.MD5)
System\Security\Cryptography\HKDF.cs (6)
31public static byte[] Extract(HashAlgorithmName hashAlgorithmName, byte[] ikm, byte[]? salt = null) 51public static int Extract(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, ReadOnlySpan<byte> salt, Span<byte> prk) 83public static byte[] Expand(HashAlgorithmName hashAlgorithmName, byte[] prk, int outputLength, byte[]? info = null) 118public static void Expand(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info) 147public static byte[] DeriveKey(HashAlgorithmName hashAlgorithmName, byte[] ikm, int outputLength, byte[]? salt = null, byte[]? info = null) 175public static void DeriveKey(HashAlgorithmName hashAlgorithmName, ReadOnlySpan<byte> ikm, Span<byte> output, ReadOnlySpan<byte> salt, ReadOnlySpan<byte> info)
System\Security\Cryptography\HKDF.OpenSsl.cs (3)
13HashAlgorithmName hashAlgorithmName, 33HashAlgorithmName hashAlgorithmName, 53HashAlgorithmName hashAlgorithmName,
System\Security\Cryptography\HKDFManagedImplementation.cs (3)
12internal static void Extract(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> ikm, ReadOnlySpan<byte> salt, Span<byte> prk) 19internal static void Expand(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> prk, Span<byte> output, ReadOnlySpan<byte> info) 86internal static void DeriveKey(HashAlgorithmName hashAlgorithmName, int hashLength, ReadOnlySpan<byte> ikm, Span<byte> output, ReadOnlySpan<byte> salt, ReadOnlySpan<byte> info)
System\Security\Cryptography\IncrementalHash.cs (10)
15private readonly HashAlgorithmName _algorithmName; 28private IncrementalHash(HashAlgorithmName name, HashProvider hash) 38private IncrementalHash(HashAlgorithmName name, HMACCommon hmac) 51public HashAlgorithmName AlgorithmName => _algorithmName; 319/// <paramref name="hashAlgorithm"/>.<see cref="HashAlgorithmName.Name"/> is <c>null</c>, or 323public static IncrementalHash CreateHash(HashAlgorithmName hashAlgorithm) 349/// <paramref name="hashAlgorithm"/>.<see cref="HashAlgorithmName.Name"/> is <c>null</c>, or 353public static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, byte[] key) 378/// <paramref name="hashAlgorithm"/>.<see cref="HashAlgorithmName.Name"/> is <c>null</c>, or 382public static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> key)
System\Security\Cryptography\MD5CryptoServiceProvider.cs (1)
18_incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.MD5);
System\Security\Cryptography\PbeParameters.cs (2)
9public HashAlgorithmName HashAlgorithm { get; } 14HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\Pbkdf2Implementation.OpenSsl.cs (1)
14HashAlgorithmName hashAlgorithmName,
System\Security\Cryptography\Rfc2898DeriveBytes.cs (17)
30public HashAlgorithmName HashAlgorithm { get; } 34: this(password, salt, iterations, HashAlgorithmName.SHA1) 39public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations, HashAlgorithmName hashAlgorithm) 52: this(password, salt, iterations, HashAlgorithmName.SHA1) 57public Rfc2898DeriveBytes(string password, byte[] salt, int iterations, HashAlgorithmName hashAlgorithm) 75: this(password, saltSize, iterations, HashAlgorithmName.SHA1) 80public Rfc2898DeriveBytes(string password, int saltSize, int iterations, HashAlgorithmName hashAlgorithm) 98internal Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations, HashAlgorithmName hashAlgorithm, bool clearPassword) : 111internal Rfc2898DeriveBytes(ReadOnlySpan<byte> password, ReadOnlySpan<byte> salt, int iterations, HashAlgorithmName hashAlgorithm) 247HashAlgorithmName hashAlgorithm = HashAlgorithm; 255if (hashAlgorithm != HashAlgorithmName.SHA1 && 256hashAlgorithm != HashAlgorithmName.SHA256 && 257hashAlgorithm != HashAlgorithmName.SHA384 && 258hashAlgorithm != HashAlgorithmName.SHA512 && 259hashAlgorithm != HashAlgorithmName.SHA3_256 && 260hashAlgorithm != HashAlgorithmName.SHA3_384 && 261hashAlgorithm != HashAlgorithmName.SHA3_512)
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (49)
32/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> 37/// are <see cref="HashAlgorithmName.SHA1" />, <see cref="HashAlgorithmName.SHA256" />, 38/// <see cref="HashAlgorithmName.SHA384" />, and <see cref="HashAlgorithmName.SHA512" />. 44HashAlgorithmName hashAlgorithm, 67/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> 72/// are <see cref="HashAlgorithmName.SHA1" />, <see cref="HashAlgorithmName.SHA256" />, 73/// <see cref="HashAlgorithmName.SHA384" />, and <see cref="HashAlgorithmName.SHA512" />. 79HashAlgorithmName hashAlgorithm, 104/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> 109/// are <see cref="HashAlgorithmName.SHA1" />, <see cref="HashAlgorithmName.SHA256" />, 110/// <see cref="HashAlgorithmName.SHA384" />, and <see cref="HashAlgorithmName.SHA512" />. 117HashAlgorithmName hashAlgorithm) 143/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> 148/// are <see cref="HashAlgorithmName.SHA1" />, <see cref="HashAlgorithmName.SHA256" />, 149/// <see cref="HashAlgorithmName.SHA384" />, and <see cref="HashAlgorithmName.SHA512" />. 157/// and use <see cref="Pbkdf2(byte[], byte[], int, HashAlgorithmName, int)" />. 163HashAlgorithmName hashAlgorithm, 186/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> 191/// are <see cref="HashAlgorithmName.SHA1" />, <see cref="HashAlgorithmName.SHA256" />, 192/// <see cref="HashAlgorithmName.SHA384" />, and <see cref="HashAlgorithmName.SHA512" />. 200/// and use <see cref="Pbkdf2(ReadOnlySpan{byte}, ReadOnlySpan{byte}, int, HashAlgorithmName, int)" />. 206HashAlgorithmName hashAlgorithm, 231/// <paramref name="hashAlgorithm" /> has a <see cref="HashAlgorithmName.Name" /> 236/// are <see cref="HashAlgorithmName.SHA1" />, <see cref="HashAlgorithmName.SHA256" />, 237/// <see cref="HashAlgorithmName.SHA384" />, and <see cref="HashAlgorithmName.SHA512" />. 245/// and use <see cref="Pbkdf2(ReadOnlySpan{byte}, ReadOnlySpan{byte}, Span{byte}, int, HashAlgorithmName)" />. 252HashAlgorithmName hashAlgorithm) 266HashAlgorithmName hashAlgorithm) 307HashAlgorithmName hashAlgorithm) 320private static void ValidateHashAlgorithm(HashAlgorithmName hashAlgorithm) 326if (hashAlgorithmName == HashAlgorithmName.SHA1.Name || 327hashAlgorithmName == HashAlgorithmName.SHA256.Name || 328hashAlgorithmName == HashAlgorithmName.SHA384.Name || 329hashAlgorithmName == HashAlgorithmName.SHA512.Name) 334if (hashAlgorithmName == HashAlgorithmName.SHA3_256.Name || 335hashAlgorithmName == HashAlgorithmName.SHA3_384.Name || 336hashAlgorithmName == HashAlgorithmName.SHA3_512.Name)
System\Security\Cryptography\RSA.cs (33)
93public virtual byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => throw DerivedClassMustOverride(); 94public virtual bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => throw DerivedClassMustOverride(); 96protected virtual byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) => 99protected virtual byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) => 306protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) 341public virtual bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 356public virtual bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => 372public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 383HashAlgorithmName hashAlgorithm, 401public virtual byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 411public virtual bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 434/// <paramref name="padding" /> or <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 437/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 454/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 456public byte[] SignData(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 465(HashAlgorithmName HashAlgorithm, RSASignaturePadding Padding) state, 487/// <paramref name="padding" /> or <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 491/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 513/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 518HashAlgorithmName hashAlgorithm, 540/// <paramref name="padding" /> or <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 543/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 560/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 562public byte[] SignHash(ReadOnlySpan<byte> hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 571(HashAlgorithmName HashAlgorithm, RSASignaturePadding Padding) state, 589/// <paramref name="padding" /> or <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is <see langword="null" />. 593/// <paramref name="hashAlgorithm" />'s <see cref="HashAlgorithmName.Name" /> is an empty string. 615/// or <see cref="SignHash(byte[], HashAlgorithmName, RSASignaturePadding)" />. 620HashAlgorithmName hashAlgorithm, 634public bool VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 646HashAlgorithmName hashAlgorithm, 665public bool VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 676public virtual bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (14)
177public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 191public override byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 205public override bool TrySignData(ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 228public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 242public override bool TrySignHash(ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) 263HashAlgorithmName algName = CapiHelper.NameOrOidToHashAlgorithmName(str); 272public override bool VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 286public override bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 300public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 308public override bool VerifyHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 365private static void CheckSHA3HashAlgorithm(HashAlgorithmName hashAlgorithm) 367if (hashAlgorithm == HashAlgorithmName.SHA3_256 || 368hashAlgorithm == HashAlgorithmName.SHA3_384 || 369hashAlgorithm == HashAlgorithmName.SHA3_512)
System\Security\Cryptography\RSAEncryptionPadding.cs (12)
21public static RSAEncryptionPadding OaepSHA1 { get; } = CreateOaep(HashAlgorithmName.SHA1); 26public static RSAEncryptionPadding OaepSHA256 { get; } = CreateOaep(HashAlgorithmName.SHA256); 31public static RSAEncryptionPadding OaepSHA384 { get; } = CreateOaep(HashAlgorithmName.SHA384); 36public static RSAEncryptionPadding OaepSHA512 { get; } = CreateOaep(HashAlgorithmName.SHA512); 41public static RSAEncryptionPadding OaepSHA3_256 { get; } = CreateOaep(HashAlgorithmName.SHA3_256); 46public static RSAEncryptionPadding OaepSHA3_384 { get; } = CreateOaep(HashAlgorithmName.SHA3_384); 51public static RSAEncryptionPadding OaepSHA3_512 { get; } = CreateOaep(HashAlgorithmName.SHA3_512); 54private readonly HashAlgorithmName _oaepHashAlgorithm; 56private RSAEncryptionPadding(RSAEncryptionPaddingMode mode, HashAlgorithmName oaepHashAlgorithm) 66public static RSAEncryptionPadding CreateOaep(HashAlgorithmName hashAlgorithm) 85/// If <see cref="Mode"/> is not <see cref="RSAEncryptionPaddingMode.Oaep"/>, then <see cref="HashAlgorithmName.Name" /> will be null. 87public HashAlgorithmName OaepHashAlgorithm
System\Security\Cryptography\RSAWrapper.cs (9)
58HashAlgorithmName hashAlgorithm, 65HashAlgorithmName hashAlgorithm, 86HashAlgorithmName hashAlgorithm, 94HashAlgorithmName hashAlgorithm, 110HashAlgorithmName hashAlgorithm, 114public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => 120HashAlgorithmName hashAlgorithm, 130HashAlgorithmName hashAlgorithm, 137HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\SHA1CryptoServiceProvider.cs (1)
21_incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1);
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (1)
21_incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.SHA256);
System\Security\Cryptography\SHA384CryptoServiceProvider.cs (1)
21_incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.SHA384);
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (1)
21_incrementalHash = IncrementalHash.CreateHash(HashAlgorithmName.SHA512);
System\Security\Cryptography\SP800108HmacCounterKdf.OpenSsl.cs (4)
12HashAlgorithmName hashAlgorithm) 26HashAlgorithmName hashAlgorithm, 47HashAlgorithmName hashAlgorithm, 64HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (3)
13public SP800108HmacCounterKdfImplementationManaged(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm) 23HashAlgorithmName hashAlgorithm, 82HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\SP800108HmacCounterKdfImplementationOpenSsl.cs (4)
13private readonly HashAlgorithmName _hashAlgorithm; 16internal unsafe SP800108HmacCounterKdfImplementationOpenSsl(ReadOnlySpan<byte> key, HashAlgorithmName hashAlgorithm) 74HashAlgorithmName hashAlgorithm, 97HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (7)
55public HashAlgorithmName HashAlgorithm { get; } 71public CertificateRequest(string subjectName, ECDsa key, HashAlgorithmName hashAlgorithm) 98public CertificateRequest(X500DistinguishedName subjectName, ECDsa key, HashAlgorithmName hashAlgorithm) 129public CertificateRequest(string subjectName, RSA key, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) 164HashAlgorithmName hashAlgorithm, 193public CertificateRequest(X500DistinguishedName subjectName, PublicKey publicKey, HashAlgorithmName hashAlgorithm) 223HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (11)
20HashAlgorithmName signerHashAlgorithm, 35HashAlgorithmName signerHashAlgorithm, 82HashAlgorithmName signerHashAlgorithm, 99HashAlgorithmName signerHashAlgorithm, 116HashAlgorithmName signerHashAlgorithm, 300HashAlgorithmName hashAlg; 314hashAlg = HashAlgorithmName.FromOid(pssParams.HashAlgorithm.Algorithm); 327hashAlg = HashAlgorithmName.SHA256; 331hashAlg = HashAlgorithmName.SHA384; 335hashAlg = HashAlgorithmName.SHA512; 339hashAlg = HashAlgorithmName.SHA1;
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (8)
53/// <see cref="HashAlgorithmName.Name"/>. 95/// <see cref="HashAlgorithmName.Name"/>. 112HashAlgorithmName hashAlgorithm, 130HashAlgorithmName hashAlgorithm, 273/// <see cref="HashAlgorithmName.Name"/>. 283/// <see cref="HashAlgorithmName.Name"/>. 297HashAlgorithmName hashAlgorithm, 317HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (8)
21public override byte[] GetSignatureAlgorithmIdentifier(HashAlgorithmName hashAlgorithm) 25if (hashAlgorithm == HashAlgorithmName.SHA256) 29else if (hashAlgorithm == HashAlgorithmName.SHA384) 33else if (hashAlgorithm == HashAlgorithmName.SHA512) 37else if (hashAlgorithm == HashAlgorithmName.SHA3_256) 41else if (hashAlgorithm == HashAlgorithmName.SHA3_384) 45else if (hashAlgorithm == HashAlgorithmName.SHA3_512) 64public override byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm)
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
52if (!certificate.TryGetCertHash(HashAlgorithmName.SHA1, hashBuffer, out int hashBytesWritten) ||
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (1)
37internal byte[] ToPkcs10Request(X509SignatureGenerator signatureGenerator, HashAlgorithmName hashAlgorithm)
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (8)
20public override byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) 47public override byte[] GetSignatureAlgorithmIdentifier(HashAlgorithmName hashAlgorithm) 51if (hashAlgorithm == HashAlgorithmName.SHA256) 55else if (hashAlgorithm == HashAlgorithmName.SHA384) 59else if (hashAlgorithm == HashAlgorithmName.SHA512) 63else if (hashAlgorithm == HashAlgorithmName.SHA3_256) 67else if (hashAlgorithm == HashAlgorithmName.SHA3_384) 71else if (hashAlgorithm == HashAlgorithmName.SHA3_512)
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (5)
26public override byte[] GetSignatureAlgorithmIdentifier(HashAlgorithmName hashAlgorithm) 38if (hashAlgorithm == HashAlgorithmName.SHA256) 43else if (hashAlgorithm == HashAlgorithmName.SHA384) 48else if (hashAlgorithm == HashAlgorithmName.SHA512) 104public override byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm)
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (1)
17new PbeParameters(PbeEncryptionAlgorithm.TripleDes3KeyPkcs12, HashAlgorithmName.SHA1, 2000);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (4)
360public virtual byte[] GetCertHash(HashAlgorithmName hashAlgorithm) 367HashAlgorithmName hashAlgorithm, 382public virtual string GetCertHashString(HashAlgorithmName hashAlgorithm) 388internal static string GetCertHashString(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> rawData)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (7)
599/// <paramref name="hashAlgorithm"/>.<see cref="HashAlgorithmName.Name"/> is <see langword="null"/> or empty. 622public X509Certificate2Collection FindByThumbprint(HashAlgorithmName hashAlgorithm, string thumbprintHex) 636/// <paramref name="hashAlgorithm"/>.<see cref="HashAlgorithmName.Name"/> is <see langword="null"/> or empty. 659public X509Certificate2Collection FindByThumbprint(HashAlgorithmName hashAlgorithm, ReadOnlySpan<char> thumbprintHex) 695/// <paramref name="hashAlgorithm"/>.<see cref="HashAlgorithmName.Name"/> is <see langword="null"/> or empty. 709public X509Certificate2Collection FindByThumbprint(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> thumbprintBytes) 715private X509Certificate2Collection FindByThumbprintCore(HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> thumbprintBytes)
System\Security\Cryptography\X509Certificates\X509SignatureGenerator.cs (2)
12public abstract byte[] GetSignatureAlgorithmIdentifier(HashAlgorithmName hashAlgorithm); 13public abstract byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (9)
188return HashSubjectPublicKeyInfo(key, HashAlgorithmName.SHA1); 190return HashSubjectPublicKeyInfo(key, HashAlgorithmName.SHA256); 192return HashSubjectPublicKeyInfo(key, HashAlgorithmName.SHA384); 194return HashSubjectPublicKeyInfo(key, HashAlgorithmName.SHA512); 196return HashSubjectPublicKeyLeft160Bits(key, HashAlgorithmName.SHA256); 198return HashSubjectPublicKeyLeft160Bits(key, HashAlgorithmName.SHA384); 200return HashSubjectPublicKeyLeft160Bits(key, HashAlgorithmName.SHA512); 206private static byte[] HashSubjectPublicKeyLeft160Bits(PublicKey key, HashAlgorithmName hashAlgorithmName) 215private static byte[] HashSubjectPublicKeyInfo(PublicKey key, HashAlgorithmName hashAlgorithmName)
System.Security.Cryptography.Cose (29)
System\Security\Cryptography\Cose\CoseHelpers.cs (9)
145private static int SignHashWithRSA(RSA key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, Span<byte> destination) 259internal static HashAlgorithmName GetHashAlgorithmFromCoseAlgorithmAndKeyType(int algorithm, KeyType keyType, out RSASignaturePadding? padding) 266KnownCoseAlgorithms.ES256 => HashAlgorithmName.SHA256, 267KnownCoseAlgorithms.ES384 => HashAlgorithmName.SHA384, 268KnownCoseAlgorithms.ES512 => HashAlgorithmName.SHA512, 275HashAlgorithmName hashAlgorithm = algorithm switch 277KnownCoseAlgorithms.PS256 or KnownCoseAlgorithms.RS256 => HashAlgorithmName.SHA256, 278KnownCoseAlgorithms.PS384 or KnownCoseAlgorithms.RS384 => HashAlgorithmName.SHA384, 279KnownCoseAlgorithms.PS512 or KnownCoseAlgorithms.RS512 => HashAlgorithmName.SHA512,
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (1)
489HashAlgorithmName hashAlgorithm = signer.HashAlgorithm;
System\Security\Cryptography\Cose\CoseSign1Message.cs (3)
620HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 720HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 741private bool VerifyHash(AsymmetricAlgorithm key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, KeyType keyType, RSASignaturePadding? padding)
System\Security\Cryptography\Cose\CoseSignature.cs (3)
395HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 428HashAlgorithmName hashAlgorithm = CoseHelpers.GetHashAlgorithmFromCoseAlgorithmAndKeyType(nullableAlg.Value, keyType, out RSASignaturePadding? padding); 451private bool VerifyHash(AsymmetricAlgorithm key, IncrementalHash hasher, HashAlgorithmName hashAlgorithm, KeyType keyType, RSASignaturePadding? padding)
System\Security\Cryptography\Cose\CoseSigner.cs (13)
28public HashAlgorithmName HashAlgorithm { get; } 46/// <paramref name="key"/> is <see cref="RSA"/>, use <see cref="CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap?, CoseHeaderMap?)"/> to specify a signature padding. 65public CoseSigner(AsymmetricAlgorithm key, HashAlgorithmName hashAlgorithm, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null) 104public CoseSigner(RSA key, RSASignaturePadding signaturePadding, HashAlgorithmName hashAlgorithm, CoseHeaderMap? protectedHeaders = null, CoseHeaderMap? unprotectedHeaders = null) 182nameof(HashAlgorithmName.SHA256) => KnownCoseAlgorithms.ES256, 183nameof(HashAlgorithmName.SHA384) => KnownCoseAlgorithms.ES384, 184nameof(HashAlgorithmName.SHA512) => KnownCoseAlgorithms.ES512, 196nameof(HashAlgorithmName.SHA256) => KnownCoseAlgorithms.PS256, 197nameof(HashAlgorithmName.SHA384) => KnownCoseAlgorithms.PS384, 198nameof(HashAlgorithmName.SHA512) => KnownCoseAlgorithms.PS512, 207nameof(HashAlgorithmName.SHA256) => KnownCoseAlgorithms.RS256, 208nameof(HashAlgorithmName.SHA384) => KnownCoseAlgorithms.RS384, 209nameof(HashAlgorithmName.SHA512) => KnownCoseAlgorithms.RS512,
System.Security.Cryptography.Pkcs (128)
Internal\Cryptography\PkcsHelpers.cs (10)
30internal static HashAlgorithmName GetDigestAlgorithm(Oid oid) 36internal static HashAlgorithmName GetDigestAlgorithm(string? oidValue, bool forVerification = false) 42return HashAlgorithmName.MD5; 45return HashAlgorithmName.SHA1; 48return HashAlgorithmName.SHA256; 51return HashAlgorithmName.SHA384; 54return HashAlgorithmName.SHA512; 58return HashAlgorithmName.SHA3_256; 61return HashAlgorithmName.SHA3_384; 64return HashAlgorithmName.SHA3_512;
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (9)
204internal static string GetOidFromHashAlgorithm(HashAlgorithmName algName) 206if (algName == HashAlgorithmName.MD5) 208if (algName == HashAlgorithmName.SHA1) 210if (algName == HashAlgorithmName.SHA256) 212if (algName == HashAlgorithmName.SHA384) 214if (algName == HashAlgorithmName.SHA512) 217if (algName == HashAlgorithmName.SHA3_256) 219if (algName == HashAlgorithmName.SHA3_384) 221if (algName == HashAlgorithmName.SHA3_512)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (6)
21HashAlgorithmName hashAlgorithm; 30hashAlgorithm = HashAlgorithmName.MD5; 34hashAlgorithm = HashAlgorithmName.SHA1; 38hashAlgorithm = HashAlgorithmName.SHA256; 42hashAlgorithm = HashAlgorithmName.SHA384; 46hashAlgorithm = HashAlgorithmName.SHA512;
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (25)
44if (pbeParameters.HashAlgorithm != HashAlgorithmName.SHA1) 88HashAlgorithmName digestAlgorithmName; 96digestAlgorithmName = HashAlgorithmName.MD5; 100digestAlgorithmName = HashAlgorithmName.MD5; 104digestAlgorithmName = HashAlgorithmName.SHA1; 108digestAlgorithmName = HashAlgorithmName.SHA1; 112digestAlgorithmName = HashAlgorithmName.SHA1; 117digestAlgorithmName = HashAlgorithmName.SHA1; 123digestAlgorithmName = HashAlgorithmName.SHA1; 129digestAlgorithmName = HashAlgorithmName.SHA1; 280HashAlgorithmName prf = pbeParameters.HashAlgorithm; 282if (prf == HashAlgorithmName.SHA256) 286else if (prf == HashAlgorithmName.SHA384) 290else if (prf == HashAlgorithmName.SHA512) 294else if (prf == HashAlgorithmName.SHA1) 328HashAlgorithmName prf = pbeParameters.HashAlgorithm; 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 748HashAlgorithmName prf = pbkdf2Params.Prf.Algorithm switch 750Oids.HmacWithSha1 => HashAlgorithmName.SHA1, 751Oids.HmacWithSha256 => HashAlgorithmName.SHA256, 752Oids.HmacWithSha384 => HashAlgorithmName.SHA384, 753Oids.HmacWithSha512 => HashAlgorithmName.SHA512, 858HashAlgorithmName hashAlgorithm, 1116HashAlgorithmName prf, 1133HashAlgorithmName prf)
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (2)
153HashAlgorithmName hashAlgorithm, 165HashAlgorithmName hashAlgorithm,
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (11)
20private static readonly (HashAlgorithmName, int, int)[] s_uvLookup = new[] 22(HashAlgorithmName.MD5, 128, 512), 23(HashAlgorithmName.SHA1, 160, 512), 24(HashAlgorithmName.SHA256, 256, 512), 25(HashAlgorithmName.SHA384, 384, 1024), 26(HashAlgorithmName.SHA512, 512, 1024), 31HashAlgorithmName hashAlgorithm, 47HashAlgorithmName hashAlgorithm, 63HashAlgorithmName hashAlgorithm, 79HashAlgorithmName hashAlgorithm, 89foreach ((HashAlgorithmName, int, int) huv in s_uvLookup)
System\Security\Cryptography\Pkcs\CmsSignature.cs (3)
41HashAlgorithmName digestAlgorithmName, 51HashAlgorithmName hashAlgorithmName, 120HashAlgorithmName hashAlgorithmName,
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (12)
19lookup.Add(Oids.DsaWithSha1, new DSACmsSignature(Oids.DsaWithSha1, HashAlgorithmName.SHA1)); 20lookup.Add(Oids.DsaWithSha256, new DSACmsSignature(Oids.DsaWithSha256, HashAlgorithmName.SHA256)); 21lookup.Add(Oids.DsaWithSha384, new DSACmsSignature(Oids.DsaWithSha384, HashAlgorithmName.SHA384)); 22lookup.Add(Oids.DsaWithSha512, new DSACmsSignature(Oids.DsaWithSha512, HashAlgorithmName.SHA512)); 29private readonly HashAlgorithmName _expectedDigest; 34internal DSACmsSignature(string? signatureAlgorithm, HashAlgorithmName expectedDigest) 54HashAlgorithmName digestAlgorithmName, 109HashAlgorithmName hashAlgorithmName, 133hashAlgorithmName == HashAlgorithmName.SHA1 ? Oids.DsaWithSha1 : 134hashAlgorithmName == HashAlgorithmName.SHA256 ? Oids.DsaWithSha256 : 135hashAlgorithmName == HashAlgorithmName.SHA384 ? Oids.DsaWithSha384 : 136hashAlgorithmName == HashAlgorithmName.SHA512 ? Oids.DsaWithSha512 :
System\Security\Cryptography\Pkcs\CmsSignature.ECDsa.cs (18)
16lookup.Add(Oids.ECDsaWithSha1, new ECDsaCmsSignature(Oids.ECDsaWithSha1, HashAlgorithmName.SHA1)); 17lookup.Add(Oids.ECDsaWithSha256, new ECDsaCmsSignature(Oids.ECDsaWithSha256, HashAlgorithmName.SHA256)); 18lookup.Add(Oids.ECDsaWithSha384, new ECDsaCmsSignature(Oids.ECDsaWithSha384, HashAlgorithmName.SHA384)); 19lookup.Add(Oids.ECDsaWithSha512, new ECDsaCmsSignature(Oids.ECDsaWithSha512, HashAlgorithmName.SHA512)); 21lookup.Add(Oids.ECDsaWithSha3_256, new ECDsaCmsSignature(Oids.ECDsaWithSha3_256, HashAlgorithmName.SHA3_256)); 22lookup.Add(Oids.ECDsaWithSha3_384, new ECDsaCmsSignature(Oids.ECDsaWithSha3_384, HashAlgorithmName.SHA3_384)); 23lookup.Add(Oids.ECDsaWithSha3_512, new ECDsaCmsSignature(Oids.ECDsaWithSha3_512, HashAlgorithmName.SHA3_512)); 30private readonly HashAlgorithmName? _expectedDigest; 35internal ECDsaCmsSignature(string? signatureAlgorithm, HashAlgorithmName? expectedDigest) 55HashAlgorithmName digestAlgorithmName, 113HashAlgorithmName hashAlgorithmName, 135hashAlgorithmName == HashAlgorithmName.SHA1 ? Oids.ECDsaWithSha1 : 136hashAlgorithmName == HashAlgorithmName.SHA256 ? Oids.ECDsaWithSha256 : 137hashAlgorithmName == HashAlgorithmName.SHA384 ? Oids.ECDsaWithSha384 : 138hashAlgorithmName == HashAlgorithmName.SHA512 ? Oids.ECDsaWithSha512 : 140hashAlgorithmName == HashAlgorithmName.SHA3_256 ? Oids.ECDsaWithSha3_256 : 141hashAlgorithmName == HashAlgorithmName.SHA3_384 ? Oids.ECDsaWithSha3_384 : 142hashAlgorithmName == HashAlgorithmName.SHA3_512 ? Oids.ECDsaWithSha3_512 :
System\Security\Cryptography\Pkcs\CmsSignature.RSA.cs (22)
19lookup.Add(Oids.RsaPkcs1Sha1, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha1, HashAlgorithmName.SHA1)); 20lookup.Add(Oids.RsaPkcs1Sha256, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha256, HashAlgorithmName.SHA256)); 21lookup.Add(Oids.RsaPkcs1Sha384, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha384, HashAlgorithmName.SHA384)); 22lookup.Add(Oids.RsaPkcs1Sha512, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha512, HashAlgorithmName.SHA512)); 24lookup.Add(Oids.RsaPkcs1Sha3_256, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha3_256, HashAlgorithmName.SHA3_256)); 25lookup.Add(Oids.RsaPkcs1Sha3_384, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha3_384, HashAlgorithmName.SHA3_384)); 26lookup.Add(Oids.RsaPkcs1Sha3_512, new RSAPkcs1CmsSignature(Oids.RsaPkcs1Sha3_512, HashAlgorithmName.SHA3_512)); 34private readonly HashAlgorithmName? _expectedDigest; 36protected RSACmsSignature(string? signatureAlgorithm, HashAlgorithmName? expectedDigest) 56HashAlgorithmName digestAlgorithmName, 96HashAlgorithmName digestAlgorithmName, 105HashAlgorithmName hashAlgorithmName, 173public RSAPkcs1CmsSignature(string? signatureAlgorithm, HashAlgorithmName? expectedDigest) 181HashAlgorithmName digestAlgorithmName, 205HashAlgorithmName hashAlgorithmName, 296HashAlgorithmName digestAlgorithmName, 325HashAlgorithmName hashAlgorithmName, 346if (hashAlgorithmName == HashAlgorithmName.SHA1) 350else if (hashAlgorithmName == HashAlgorithmName.SHA256) 354else if (hashAlgorithmName == HashAlgorithmName.SHA384) 358else if (hashAlgorithmName == HashAlgorithmName.SHA512) 366Debug.Assert(hashAlgorithmName == HashAlgorithmName.MD5, $"Unsupported digest algorithm '{hashAlgorithmName.Name}'");
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
183HashAlgorithmName hashAlgorithmName = PkcsHelpers.GetDigestAlgorithm(DigestAlgorithm);
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (3)
166HashAlgorithmName hashAlgorithm, 193HashAlgorithmName hashAlgorithm, 216HashAlgorithmName hashAlgorithm,
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (4)
99HashAlgorithmName hashAlgorithm, 180HashAlgorithmName hashAlgorithmName = PkcsHelpers.GetDigestAlgorithm(hashAlgorithmId); 494if (!signerCert.TryGetCertHash(HashAlgorithmName.SHA1, thumbprint, out int written) || 518HashAlgorithmName alg;
System\Security\Cryptography\Pkcs\SignerInfo.cs (2)
551HashAlgorithmName hashAlgorithmName = GetDigestAlgorithm(); 798private HashAlgorithmName GetDigestAlgorithm()
System.Security.Cryptography.Primitives (1)
System.Security.Cryptography.Primitives.cs (1)
15[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HashAlgorithmName))]
Templates.Blazor.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Blazor.WebAssembly.Auth.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Blazor.WebAssembly.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Mvc.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
Templates.Tests (3)
src\Shared\CertificateGeneration\CertificateManager.cs (3)
541keyBytes = key.ExportEncryptedPkcs8PrivateKey(password, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 100000)); 550keyBytes = key.ExportEncryptedPkcs8PrivateKey(string.Empty, new PbeParameters(PbeEncryptionAlgorithm.Aes256Cbc, HashAlgorithmName.SHA256, 1)); 780var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
WebTransportInteractiveSampleApp (1)
Program.cs (1)
183CertificateRequest req = new("CN=localhost", ec, HashAlgorithmName.SHA256);
WebTransportSampleApp (1)
Program.cs (1)
69CertificateRequest req = new("CN=localhost", ec, HashAlgorithmName.SHA256);