示例#1
0
 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);
 }
示例#2
0
        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));
        }