Secure edit control class. Supports storing passwords in an encrypted form in the process memory (Windows only).
Inheritance: QtCore.QObject
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 2
0
        public PassphraseDialog()
        {
            SetupUi(this);
              Message = string.Empty;

              mSecureEdit = new SecureEdit();

              ShowEvent += PassphraseDialog_ShowEvent;
              HideEvent += PassphraseDialog_HideEvent;
        }
Ejemplo n.º 3
0
        public PassphraseDialog()
        {
            SetupUi(this);
            Message = string.Empty;

            mSecureEdit = new SecureEdit();

            ShowEvent += PassphraseDialog_ShowEvent;
            HideEvent += PassphraseDialog_HideEvent;
        }
Ejemplo n.º 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;
            }
              }
        }