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); }
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; }