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

            byte[] pbThis  = this.ToUtf8();
            byte[] pbOther = secOther.ToUtf8();

            bool bEqual = true;

            if (pbThis.Length != pbOther.Length)
            {
                bEqual = false;
            }
            else
            {
                for (int i = 0; i < pbThis.Length; ++i)
                {
                    if (pbThis[i] != pbOther[i])
                    {
                        bEqual = false;
                        break;
                    }
                }
            }

            Array.Clear(pbThis, 0, pbThis.Length);
            Array.Clear(pbOther, 0, pbOther.Length);
            return(bEqual);
        }
예제 #2
0
 public PasswordDialog()
 {
     InitializeComponent();
       mSecureEdit = new SecureEdit();
 }
예제 #3
0
 public PasswordDialog()
 {
     InitializeComponent();
     mSecureEdit = new SecureEdit();
 }
예제 #4
0
        public bool ContentsEqualTo(SecureEdit secOther)
        {
            Debug.Assert(secOther != null); if (secOther == null) return false;

              byte[] pbThis = this.ToUtf8();
              byte[] pbOther = secOther.ToUtf8();

              bool bEqual = true;

              if (pbThis.Length != pbOther.Length) bEqual = false;
              else {
            for (int i = 0; i < pbThis.Length; ++i) {
              if (pbThis[i] != pbOther[i]) {
            bEqual = false;
            break;
              }
            }
              }

              Array.Clear(pbThis, 0, pbThis.Length);
              Array.Clear(pbOther, 0, pbOther.Length);
              return bEqual;
        }