예제 #1
0
        /// <summary>
        /// Creates a new instance of the default implementation of the Elliptic Curve Diffie-Hellman Algorithm
        /// (ECDH) with a newly generated key over the specified curve.
        /// </summary>
        /// <param name="curve">The curve to use for key generation.</param>
        /// <returns>A new instance of the default implementation of this class.</returns>
        public static ECDiffieHellman Create(ECCurve curve)
        {
            ECDiffieHellman ecdh = Create();

            if (ecdh != null)
            {
                try {
                    ecdh.GenerateKey(curve);
                }
                catch {
                    ecdh.Dispose();
                    throw;
                }
            }

            return(ecdh);
        }
예제 #2
0
 public override void GenerateKey(ECCurve curve) => _wrapped.GenerateKey(curve);