private SendSecurityHeader CreateSendSecurityHeader(Message message, string actor, System.ServiceModel.Security.SecurityProtocolFactory factory, bool requireMessageProtection)
        {
            MessageDirection   direction      = factory.ActAsInitiator ? MessageDirection.Input : MessageDirection.Output;
            SendSecurityHeader securityHeader = factory.StandardsManager.CreateSendSecurityHeader(message, actor, true, false, factory.OutgoingAlgorithmSuite, direction);

            securityHeader.Layout = factory.SecurityHeaderLayout;
            securityHeader.RequireMessageProtection = requireMessageProtection;
            SetSecurityHeaderId(securityHeader, message);
            if (factory.AddTimestamp)
            {
                securityHeader.AddTimestamp(factory.TimestampValidityDuration);
            }
            return(securityHeader);
        }