예제 #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));
     }
 }
예제 #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));
     }
 }
예제 #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));
            }
        }