// Login Password
        public override void addPassword(Scheme scheme, int port, String hostName, String user, String password)
        {
            Host host = new Host(ProtocolFactory.get().forScheme(scheme), hostName, port);

            host.getCredentials().setUsername(user);
            PreferencesFactory.get().setProperty(new HostUrlProvider().get(host), DataProtector.Encrypt(password));
        }
        private string getPassword(Host host)
        {
            string password = PreferencesFactory.get().getProperty(new HostUrlProvider().get(host));

            if (null == password)
            {
                return(null);
            }
            return(DataProtector.Decrypt(password));
        }
예제 #3
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));
        }
예제 #4
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));
        }
 // Generic Password
 public override void addPassword(String serviceName, String user, String password)
 {
     PreferencesFactory.get().setProperty($"{serviceName} - {user}", DataProtector.Encrypt(password));
 }
예제 #7
0
        // Login Password
        public override void addPassword(Scheme scheme, int port, String hostname, String user, String password)
        {
            string url = new HostUrlProvider().withPath(false).get(scheme, port, user, hostname, null);

            PreferencesFactory.get().setProperty(url, DataProtector.Encrypt(password));
        }