[Serializable]
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public sealed class CngAlgorithm : IEquatable<CngAlgorithm> {
+ private static volatile CngAlgorithm s_ecdh;
private static volatile CngAlgorithm s_ecdhp256;
private static volatile CngAlgorithm s_ecdhp384;
private static volatile CngAlgorithm s_ecdhp521;
+ private static volatile CngAlgorithm s_ecdsa;
private static volatile CngAlgorithm s_ecdsap256;
private static volatile CngAlgorithm s_ecdsap384;
private static volatile CngAlgorithm s_ecdsap521;
}
}
+ public static CngAlgorithm ECDiffieHellman {
+ get {
+ Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
+
+ if (s_ecdh == null) {
+ s_ecdh = new CngAlgorithm(BCryptNative.AlgorithmName.ECDH);
+ }
+
+ return s_ecdh;
+ }
+ }
+
public static CngAlgorithm ECDiffieHellmanP256 {
get {
Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
}
}
+ public static CngAlgorithm ECDsa {
+ get {
+ Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
+
+ if (s_ecdsa == null) {
+ s_ecdsa = new CngAlgorithm(BCryptNative.AlgorithmName.ECDsa);
+ }
+
+ return s_ecdsa;
+ }
+ }
+
public static CngAlgorithm ECDsaP256 {
get {
Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
return s_sha512;
}
}
-
- public static CngAlgorithm ECDiffieHellman {
- get {
- throw new NotImplementedException ();
- }
- }
-
- public static CngAlgorithm ECDsa {
- get {
- throw new NotImplementedException ();
- }
- }
}
}