Ejemplo n.º 1
0
 /// <summary>
 /// Creates an ECDSA instance with a freshly generated keypair.
 /// </summary>
 /// <returns>Returns the ECDSA instance which has the generated keypair.</returns>
 public static IEnumerable <EthereumEcdsa> Generate(int count, IAccountDerivation accountFactory)
 {
     if (UseNativeLib)
     {
         return(EthereumEcdsaNative.Generate(count, accountFactory));
     }
     else
     {
         return(EthereumEcdsaBouncyCastle.Generate(count, accountFactory));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates an ECDSA instance with a freshly generated keypair.
 /// </summary>
 /// <returns>Returns the ECDSA instance which has the generated keypair.</returns>
 public static EthereumEcdsa Generate(IAccountDerivation accountFactory)
 {
     if (UseNativeLib)
     {
         return(EthereumEcdsaNative.Generate(accountFactory));
     }
     else
     {
         return(EthereumEcdsaBouncyCastle.Generate(accountFactory));
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates an ECDSA instance with a freshly generated keypair.
        /// </summary>
        /// <returns>Returns the ECDSA instance which has the generated keypair.</returns>
        public static EthereumEcdsa Generate(IAccountDerivation accountFactory = null)
        {
            // If the account factory is null, we use a random factory
            if (accountFactory == null)
            {
                accountFactory = new SystemRandomAccountDerivation();
            }

            // Determine which library to use
            if (UseNativeLib)
            {
                return(EthereumEcdsaNative.Generate(accountFactory));
            }
            else
            {
                return(EthereumEcdsaBouncyCastle.Generate(accountFactory));
            }
        }