private string getPassword(Host host)
        {
            string password = PreferencesFactory.get().getProperty(new HostUrlProvider().get(host));

            if (null == password)
            {
                return(null);
            }
            return(DataProtector.Decrypt(password));
        }
Esempio n. 2
0
        // Login Password
        public override string getPassword(Scheme scheme, int port, String hostname, String user)
        {
            string password = PreferencesFactory.get().getProperty(new HostUrlProvider().withPath(false).get(scheme, port, user, hostname, null));

            if (null == password)
            {
                return(null);
            }
            return(DataProtector.Decrypt(password));
        }
Esempio n. 3
0
        // Generic Password
        public override string getPassword(String serviceName, String user)
        {
            String password = PreferencesFactory.get().getProperty($"{serviceName} - {user}");

            if (null == password)
            {
                // Legacy implementation
                return(getPassword(Scheme.ftp, Scheme.ftp.getPort(), serviceName, user));
            }
            return(DataProtector.Decrypt(password));
        }
        // Generic Password
        public override string getPassword(String serviceName, String user)
        {
            String password = PreferencesFactory.get().getProperty($"{serviceName} - {user}");

            if (null == password)
            {
                // Legacy implementation
                Protocol ftp = ProtocolFactory.get().forScheme(Scheme.ftp);
                if (null == ftp)
                {
                    return(null);
                }
                Host host = new Host(ftp, serviceName);
                host.getCredentials().setUsername(user);
                return(getPassword(host));
            }
            return(DataProtector.Decrypt(password));
        }