Exemplo n.º 1
0
        internal static BasicHttpSecurity ToBasicHttpSecurity(BasicHttpsSecurity basicHttpsSecurity)
        {
            Fx.Assert(basicHttpsSecurity != null, "Cannot pass in a null value for basicHttpsSecurity");

            BasicHttpSecurity basicHttpSecurity = new BasicHttpSecurity()
            {
                Transport = basicHttpsSecurity.Transport,
                Mode      = BasicHttpsSecurityModeHelper.ToBasicHttpSecurityMode(basicHttpsSecurity.Mode)
            };

            return(basicHttpSecurity);
        }
Exemplo n.º 2
0
        private BasicHttpsSecurity(BasicHttpsSecurityMode mode, HttpTransportSecurity transportSecurity)
        {
            if (!BasicHttpsSecurityModeHelper.IsDefined(mode))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(mode)));
            }
            HttpTransportSecurity httpTransportSecurity = transportSecurity == null ? new HttpTransportSecurity() : transportSecurity;
            BasicHttpSecurityMode basicHttpSecurityMode = BasicHttpsSecurityModeHelper.ToBasicHttpSecurityMode(mode);

            BasicHttpSecurity = new BasicHttpSecurity()
            {
                Mode      = basicHttpSecurityMode,
                Transport = httpTransportSecurity
            };
        }
        BasicHttpsSecurity(BasicHttpsSecurityMode mode, HttpTransportSecurity transportSecurity, BasicHttpMessageSecurity messageSecurity)
        {
            if (!BasicHttpsSecurityModeHelper.IsDefined(mode))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("mode"));
            }
            HttpTransportSecurity    httpTransportSecurity = transportSecurity == null ? new HttpTransportSecurity() : transportSecurity;
            BasicHttpMessageSecurity httpMessageSecurity   = messageSecurity == null ? new BasicHttpMessageSecurity() : messageSecurity;
            BasicHttpSecurityMode    basicHttpSecurityMode = BasicHttpsSecurityModeHelper.ToBasicHttpSecurityMode(mode);

            this.basicHttpSecurity = new BasicHttpSecurity()
            {
                Mode      = basicHttpSecurityMode,
                Transport = httpTransportSecurity,
                Message   = httpMessageSecurity
            };
        }