Secure edit control class. Supports storing passwords in an encrypted form in the process memory (Windows only).
상속: QtCore.QObject
예제 #1
0
        public bool ContentsEqualTo(SecureEdit aSecureEdit)
        {
            Debug.Assert(aSecureEdit != null);
            if (aSecureEdit == null)
            {
                return(false);
            }

            using (var thisString = new PinnedArray <byte>(this.ToUtf8())) {
                using (var otherString = new PinnedArray <byte>(aSecureEdit.ToUtf8())) {
                    if (thisString.Data.Length != otherString.Data.Length)
                    {
                        return(false);
                    }
                    else
                    {
                        for (int i = 0; i < thisString.Data.Length; ++i)
                        {
                            if (thisString.Data[i] != otherString.Data [i])
                            {
                                return(false);
                            }
                        }
                    }
                    return(true);
                }
            }
        }
예제 #2
0
        public PassphraseDialog()
        {
            SetupUi(this);
              Message = string.Empty;

              mSecureEdit = new SecureEdit();

              ShowEvent += PassphraseDialog_ShowEvent;
              HideEvent += PassphraseDialog_HideEvent;
        }
예제 #3
0
        public PassphraseDialog()
        {
            SetupUi(this);
            Message = string.Empty;

            mSecureEdit = new SecureEdit();

            ShowEvent += PassphraseDialog_ShowEvent;
            HideEvent += PassphraseDialog_HideEvent;
        }
예제 #4
0
        public bool ContentsEqualTo(SecureEdit aSecureEdit)
        {
            Debug.Assert(aSecureEdit != null);
              if (aSecureEdit == null) {
            return false;
              }

              using (var thisString = new PinnedArray<byte>(this.ToUtf8())) {
            using (var otherString = new PinnedArray<byte>(aSecureEdit.ToUtf8())) {

              if (thisString.Data.Length != otherString.Data.Length) {
            return false;
              } else {
            for (int i = 0; i < thisString.Data.Length; ++i) {
              if (thisString.Data[i] != otherString.Data [i]) {
                return false;
              }
            }
              }
              return true;
            }
              }
        }