private bool VerifyUserPassword(string pwd) { int num1; EncryptionStandard standard1 = new EncryptionStandard(); standard1.mV = this.mV; standard1.mDocId = this.mDocId; standard1.mKeyLength = this.mKeyLength; standard1.mOEntry = this.mOEntry; standard1.mPerm = this.mPerm; standard1.mRev = this.mRev; standard1.mEncMetadata = this.mEncMetadata; standard1.mUserPassword = pwd; standard1.UEntry; if (standard1.UEntry.Length != this.UEntry.Length) { return(false); } for (num1 = 0; (num1 < this.UEntry.Length); num1 += 1) { if (this.UEntry[num1] != standard1.UEntry[num1]) { return(false); } } return(true); }
public static EncryptionStandard Create(string ownerPassword, string userPassword, UserAccessPermissions perm, int keyLength, bool encMetadata) { if (ownerPassword == null) { ownerPassword = ""; } if (userPassword == null) { userPassword = ""; } EncryptionStandard standard1 = new EncryptionStandard(); standard1.mUserPassword = userPassword; standard1.mOwnerPassword = ownerPassword; standard1.mPerm = ((uint)perm); standard1.mKeyLength = keyLength; standard1.mRev = 3; standard1.mV = 2; standard1.mEncMetadata = encMetadata; return(standard1); }