コード例 #1
0
ファイル: Protocol.cs プロジェクト: niteka/WPF_ChatApp
        // Sign in user and restore RSA key from local storage.
        // Therefore user should be signed up on local device for successful sign in.
        // Otherwise generated private key should be transferred to a new device.
        public static bool SignIn(string login, string password)
        {
            if (AppUser.GetInstance().Client.SignIn(login, password))
            {
                Logger.Info("Signed in as {0}.", login);
                FetchMyself(login);
                // Restore private key.
                AppUser.GetInstance().PrivateKeyXml = CredentialsManager.Retrieve(login);
                return(true);
            }

            return(false);
        }