public SecurityAppliedMessage(Message messageToProcess, SendSecurityHeader securityHeader, bool signBody, bool encryptBody) : base(messageToProcess) { Fx.Assert(!(messageToProcess is SecurityAppliedMessage), "SecurityAppliedMessage should not be wrapped"); this.securityHeader = securityHeader; this.bodyProtectionMode = MessagePartProtectionModeHelper.GetProtectionMode(signBody, encryptBody, securityHeader.SignThenEncrypt); }
private MessagePartProtectionMode GetProtectionMode(MessageHeader header) { if (!RequireMessageProtection) { return(MessagePartProtectionMode.None); } bool sign = _signedXml != null && _effectiveSignatureParts.IsHeaderIncluded(header); bool encrypt = false; return(MessagePartProtectionModeHelper.GetProtectionMode(sign, encrypt, SignThenEncrypt)); }
private MessagePartProtectionMode GetProtectionMode(MessageHeader header) { if (!base.RequireMessageProtection) { return(MessagePartProtectionMode.None); } bool sign = (this.signedInfo != null) && this.effectiveSignatureParts.IsHeaderIncluded(header); bool encrypt = (this.referenceList != null) && base.EncryptionParts.IsHeaderIncluded(header); return(MessagePartProtectionModeHelper.GetProtectionMode(sign, encrypt, base.SignThenEncrypt)); }
public SecurityAppliedMessage(Message messageToProcess, SendSecurityHeader securityHeader, bool signBody, bool encryptBody) : base(messageToProcess) { this.bodyPrefix = "s"; this.securityHeader = securityHeader; this.bodyProtectionMode = MessagePartProtectionModeHelper.GetProtectionMode(signBody, encryptBody, securityHeader.SignThenEncrypt); }