19 instantiations of CngAlgorithm
System.Security.Cryptography (19)
System\Security\Cryptography\CngAlgorithm.cs (17)
92return s_rsa ??= new CngAlgorithm("RSA"); // BCRYPT_RSA_ALGORITHM 100return s_ecdh ??= new CngAlgorithm("ECDH"); // BCRYPT_ECDH_ALGORITHM 108return s_ecdhp256 ??= new CngAlgorithm("ECDH_P256"); // BCRYPT_ECDH_P256_ALGORITHM 116return s_ecdhp384 ??= new CngAlgorithm("ECDH_P384"); // BCRYPT_ECDH_P384_ALGORITHM 124return s_ecdhp521 ??= new CngAlgorithm("ECDH_P521"); // BCRYPT_ECDH_P521_ALGORITHM 132return s_ecdsa ??= new CngAlgorithm("ECDSA"); // BCRYPT_ECDSA_ALGORITHM 140return s_ecdsap256 ??= new CngAlgorithm("ECDSA_P256"); // BCRYPT_ECDSA_P256_ALGORITHM 148return s_ecdsap384 ??= new CngAlgorithm("ECDSA_P384"); // BCRYPT_ECDSA_P384_ALGORITHM 156return s_ecdsap521 ??= new CngAlgorithm("ECDSA_P521"); // BCRYPT_ECDSA_P521_ALGORITHM 164return s_md5 ??= new CngAlgorithm("MD5"); // BCRYPT_MD5_ALGORITHM 172return s_sha1 ??= new CngAlgorithm("SHA1"); // BCRYPT_SHA1_ALGORITHM 180return s_sha256 ??= new CngAlgorithm("SHA256"); // BCRYPT_SHA256_ALGORITHM 188return s_sha384 ??= new CngAlgorithm("SHA384"); // BCRYPT_SHA384_ALGORITHM 196return s_sha512 ??= new CngAlgorithm("SHA512"); // BCRYPT_SHA512_ALGORITHM 208public static CngAlgorithm MLDsa => field ??= new CngAlgorithm("ML-DSA"); // BCRYPT_MLDSA_ALGORITHM 218public static CngAlgorithm MLKem => field ??= new CngAlgorithm("ML-KEM"); // BCRYPT_MLKEM_ALGORITHM 229public static CngAlgorithm SlhDsa => field ??= new CngAlgorithm("SLH-DSA"); // BCRYPT_SLHDSA_ALGORITHM
System\Security\Cryptography\CngKey.StandardProperties.cs (1)
39_cachedAlgorithm = new CngAlgorithm(algorithm);
System\Security\Cryptography\DSACng.Key.cs (1)
55private readonly CngAlgorithm _dsnCng = new CngAlgorithm(BCRYPT_DSA_ALGORITHM);
102 references to CngAlgorithm
System.Core (1)
System.Core.cs (1)
201[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.CngAlgorithm))]
System.Security.Cryptography (100)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (1)
748CngAlgorithm.Rsa,
System\Security\Cryptography\CngAlgorithm.cs (44)
16public sealed class CngAlgorithm : IEquatable<CngAlgorithm> 35public static bool operator ==(CngAlgorithm? left, CngAlgorithm? right) 45public static bool operator !=(CngAlgorithm? left, CngAlgorithm? right) 59return Equals(obj as CngAlgorithm); 62public bool Equals([NotNullWhen(true)] CngAlgorithm? other) 88public static CngAlgorithm Rsa 96public static CngAlgorithm ECDiffieHellman 104public static CngAlgorithm ECDiffieHellmanP256 112public static CngAlgorithm ECDiffieHellmanP384 120public static CngAlgorithm ECDiffieHellmanP521 128public static CngAlgorithm ECDsa 136public static CngAlgorithm ECDsaP256 144public static CngAlgorithm ECDsaP384 152public static CngAlgorithm ECDsaP521 160public static CngAlgorithm MD5 168public static CngAlgorithm Sha1 176public static CngAlgorithm Sha256 184public static CngAlgorithm Sha384 192public static CngAlgorithm Sha512 201/// Gets a new <see cref="CngAlgorithm"/> object that specifies the Module-Lattice-Based Digital Signature 205/// A new <see cref="CngAlgorithm"/> object that specifies the Module-Lattice-Based Digital Signature 208public static CngAlgorithm MLDsa => field ??= new CngAlgorithm("ML-DSA"); // BCRYPT_MLDSA_ALGORITHM 211/// Gets a new <see cref="CngAlgorithm"/> object that specifies the Module-Lattice-Based Key-Encapsulation 215/// A new <see cref="CngAlgorithm"/> object that specifies the Module-Lattice-Based Key-Encapsulation 218public static CngAlgorithm MLKem => field ??= new CngAlgorithm("ML-KEM"); // BCRYPT_MLKEM_ALGORITHM 221/// Gets a new <see cref="CngAlgorithm"/> object that specifies the Stateless Hash-Based Digital Signature 225/// A new <see cref="CngAlgorithm"/> object that specifies the Stateless Hash-Based Digital Signature 229public static CngAlgorithm SlhDsa => field ??= new CngAlgorithm("SLH-DSA"); // BCRYPT_SLHDSA_ALGORITHM 231private static CngAlgorithm? s_ecdh; 232private static CngAlgorithm? s_ecdhp256; 233private static CngAlgorithm? s_ecdhp384; 234private static CngAlgorithm? s_ecdhp521; 235private static CngAlgorithm? s_ecdsa; 236private static CngAlgorithm? s_ecdsap256; 237private static CngAlgorithm? s_ecdsap384; 238private static CngAlgorithm? s_ecdsap521; 239private static CngAlgorithm? s_md5; 240private static CngAlgorithm? s_sha1; 241private static CngAlgorithm? s_sha256; 242private static CngAlgorithm? s_sha384; 243private static CngAlgorithm? s_sha512; 244private static CngAlgorithm? s_rsa;
System\Security\Cryptography\CngAlgorithmCore.cs (3)
17public CngAlgorithm? DefaultKeyType; 47public unsafe CngKey GetOrGenerateKey(int keySize, CngAlgorithm algorithm) 117_lazyKey = CngKey.Create(DefaultKeyType ?? CngAlgorithm.ECDsa, null, creationParameters);
System\Security\Cryptography\CngKey.Create.cs (3)
23public static CngKey Create(CngAlgorithm algorithm) 29public static CngKey Create(CngAlgorithm algorithm, string? keyName) 35public static CngKey Create(CngAlgorithm algorithm, string? keyName, CngKeyCreationParameters? creationParameters)
System\Security\Cryptography\CngKey.EC.cs (20)
21return (algorithm == CngAlgorithm.ECDiffieHellman.Algorithm || 22algorithm == CngAlgorithm.ECDsa.Algorithm); 42if (algorithm == CngAlgorithm.ECDiffieHellmanP256.Algorithm || 43algorithm == CngAlgorithm.ECDsaP256.Algorithm) 49if (algorithm == CngAlgorithm.ECDiffieHellmanP384.Algorithm || 50algorithm == CngAlgorithm.ECDsaP384.Algorithm) 56if (algorithm == CngAlgorithm.ECDiffieHellmanP521.Algorithm || 57algorithm == CngAlgorithm.ECDsaP521.Algorithm) 82internal static unsafe CngAlgorithm EcdsaCurveNameToAlgorithm(ReadOnlySpan<char> name) 92return CngAlgorithm.ECDsa; 97"nistp256" or "ecdsa_p256" => CngAlgorithm.ECDsaP256, 98"nistp384" or "ecdsa_p384" => CngAlgorithm.ECDsaP384, 99"nistp521" or "ecdsa_p521" => CngAlgorithm.ECDsaP521, 100_ => CngAlgorithm.ECDsa, // All other curves are new in Win10 so use generic algorithm 108internal static unsafe CngAlgorithm EcdhCurveNameToAlgorithm(ReadOnlySpan<char> name) 118return CngAlgorithm.ECDiffieHellman; 123"nistp256" or "ecdsa_p256" or "ecdh_p256" => CngAlgorithm.ECDiffieHellmanP256, 124"nistp384" or "ecdsa_p384" or "ecdh_p384" => CngAlgorithm.ECDiffieHellmanP384, 125"nistp521" or "ecdsa_p521" or "ecdh_p521" => CngAlgorithm.ECDiffieHellmanP521, 126_ => CngAlgorithm.ECDiffieHellman, // All other curves are new in Win10 so use generic algorithm
System\Security\Cryptography\CngKey.StandardProperties.cs (2)
21private CngAlgorithm? _cachedAlgorithm; 30public CngAlgorithm Algorithm
System\Security\Cryptography\CngSymmetricAlgorithmCore.cs (2)
43CngAlgorithm actualAlgorithm = cngKey.Algorithm; 57CngAlgorithm actualAlgorithm = key.Algorithm;
System\Security\Cryptography\DSACng.Key.cs (1)
55private readonly CngAlgorithm _dsnCng = new CngAlgorithm(BCRYPT_DSA_ALGORITHM);
System\Security\Cryptography\ECDiffieHellmanCng.cs (4)
14private CngAlgorithmCore _core = new CngAlgorithmCore(typeof(ECDiffieHellmanCng)) { DefaultKeyType = CngAlgorithm.ECDiffieHellman }; 15private CngAlgorithm _hashAlgorithm = CngAlgorithm.Sha256; 47public CngAlgorithm HashAlgorithm
System\Security\Cryptography\ECDiffieHellmanCng.Key.cs (8)
62CngAlgorithm alg = CngKey.EcdhCurveNameToAlgorithm(curve.Oid.FriendlyName); 72if (alg == CngAlgorithm.ECDiffieHellmanP256) 74else if (alg == CngAlgorithm.ECDiffieHellmanP384) 76else if (alg == CngAlgorithm.ECDiffieHellmanP521) 109CngAlgorithm algorithm; 116algorithm = CngAlgorithm.ECDiffieHellmanP256; 119algorithm = CngAlgorithm.ECDiffieHellmanP384; 122algorithm = CngAlgorithm.ECDiffieHellmanP521;
System\Security\Cryptography\ECDsaCng.cs (3)
14private CngAlgorithm _hashAlgorithm = CngAlgorithm.Sha256; 19public CngAlgorithm HashAlgorithm
System\Security\Cryptography\ECDsaCng.Key.cs (8)
51CngAlgorithm alg = CngKey.EcdsaCurveNameToAlgorithm(curve.Oid.FriendlyName); 61if (alg == CngAlgorithm.ECDsaP256) 63else if (alg == CngAlgorithm.ECDsaP384) 65else if (alg == CngAlgorithm.ECDsaP521) 98CngAlgorithm algorithm; 104case 256: algorithm = CngAlgorithm.ECDsaP256; break; 105case 384: algorithm = CngAlgorithm.ECDsaP384; break; 106case 521: algorithm = CngAlgorithm.ECDsaP521; break;
System\Security\Cryptography\RSACng.Key.cs (1)
24CngKey key = _core.GetOrGenerateKey(KeySize, CngAlgorithm.Rsa);
System.Security.Cryptography.Cng (1)
System.Security.Cryptography.Cng.cs (1)
9[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.CngAlgorithm))]