Exemple #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _wrapped.Dispose();
     }
 }
Exemple #2
0
        /// <summary>
        /// Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm
        /// (ECDSA) using the specified ECParameters as the key.
        /// </summary>
        /// <param name="parameters">The parameters representing the key to use.</param>
        /// <returns>A new instance of the default implementation of this class.</returns>
        public static ECDsa Create(ECParameters parameters)
        {
            ECDsa ecdsa = Create();

            if (ecdsa != null)
            {
                try {
                    ecdsa.ImportParameters(parameters);
                }
                catch {
                    ecdsa.Dispose();
                    throw;
                }
            }

            return(ecdsa);
        }
Exemple #3
0
        /// <summary>
        /// Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm
        /// (ECDSA) 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 ECDsa Create(ECCurve curve)
        {
            ECDsa ecdsa = Create();

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

            return(ecdsa);
        }