public static int Main(string[] args) { var logger = new LoggerConfiguration().WriteTo.Console().CreateLogger(); var userOutput = new ConsoleUserOutput(); userOutput.WriteLine("Catalyst Network Simulator"); var passwordRegistry = new PasswordRegistry(); Parser.Default.ParseArguments <Options>(args).WithParsed(options => passwordRegistry.SetFromOptions(options)); var fileSystem = new FileSystem(); var userInput = new ConsoleUserInput(); var consolePasswordReader = new ConsolePasswordReader(userOutput, userInput); var certificateStore = new CertificateStore(fileSystem, new PasswordManager(consolePasswordReader, passwordRegistry)); var certificate = certificateStore.ReadOrCreateCertificateFile("mycert.pfx"); var signingContext = new SigningContext { NetworkType = NetworkType.Devnet, SignatureType = SignatureType.ProtocolPeer }; var clientRpcInfoList = ConfigHelper.GenerateClientRpcInfoFromConfig(userOutput, passwordRegistry, certificate, logger, signingContext ).ToList(); var simulation = new TransactionSimulation(userOutput); var simulator = new Simulator(simulation, logger); simulator.SimulateAsync(clientRpcInfoList).Wait(); return(Environment.ExitCode); }
public void GetPasswordTest() { if (!PasswordRegistry.GetPassword("HKEY_CURRENT_CONFIG", "TanganPassword", "HKEY_CURRENT_CONFIG//TanganPassword").Equals("TestOK")) { Assert.Fail(); } }
public static void AddPassword(PasswordRegistry passwordRegistry, PasswordRegistryTypes passwordRegistryTypes, string password) { var secureString = new SecureString(); foreach (var character in password) { secureString.AppendChar(character); } passwordRegistry.AddItemToRegistry(passwordRegistryTypes, secureString); }
public static PasswordRegistry SetFromOptions(this PasswordRegistry passwordRegistry, Options options) { if (!string.IsNullOrEmpty(options.NodePassword)) { PasswordRegistryHelper.AddPassword(passwordRegistry, PasswordRegistryTypes.DefaultNodePassword, options.NodePassword); } if (!string.IsNullOrEmpty(options.SslCertPassword)) { PasswordRegistryHelper.AddPassword(passwordRegistry, PasswordRegistryTypes.CertificatePassword, options.SslCertPassword); } return(passwordRegistry); }
public Statistic() { InitializeComponent(); var mailBox = ImapMailBox.Singleton(); var config = ConfigService.Singleton(); mailBox.Connect("tangantasktest", PasswordRegistry.GetPassword("HKEY_CURRENT_CONFIG", "TanganPassword", "HKEY_CURRENT_CONFIG//TanganPassword"), config.ImapServer, config.ImapPort, config.ImapSSL); int unread = mailBox.CountUnread(); var dal = new DataAccessLayer("Database.db"); dal.Check(mailBox.LastUnreadDate()); this.label1.Text = "Количество непрочитанных сообщений: " + unread; }
protected void register_Click(object sender, EventArgs e) { string userEmail = ((TextBox)EmailRegistry.FindControl("EmailRegistry")).Text; string firstName = ((TextBox)FirstNameRegistry.FindControl("FirstNameRegistry")).Text; string lastName = ((TextBox)LastNameRegistry.FindControl("LastNameRegistry")).Text; string dateOfBirth = ((TextBox)DateOfBirth.FindControl("DateOfBirth")).Text; string password = ((TextBox)PasswordRegistry.FindControl("PasswordRegistry")).Text; string gender = ((DropDownList)GenderList.FindControl("GenderList")).Text; Session["userEmail"] = userEmail; string registerSql = "insert into [User](Password, Email, FirstName, LastName, Gender, dateOfBirth) values ('" + password + "','" + userEmail + "','" + firstName + "','" + lastName + "','" + gender + "','" + dateOfBirth + "')"; function.Create(registerSql); Response.Redirect("Homepage.aspx"); }
public void Init() { _passwordRegistry = new PasswordRegistry(); }
public PasswordRegistryTests() { _passwordRegistry = new PasswordRegistry(); }