Пример #1
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement,
                                 ProtectionScenario protectionScenario,
                                 ICollection customServiceNames)
     : this(policyEnforcement, protectionScenario,
            customServiceNames == null ? (ServiceNameCollection)null : new ServiceNameCollection(customServiceNames))
 {
 }
Пример #2
0
        protected ExtendedProtectionPolicy(SerializationInfo info, StreamingContext context)
        {
            _policyEnforcement = (PolicyEnforcement)info.GetInt32(policyEnforcementName);
            _protectionScenario = (ProtectionScenario)info.GetInt32(protectionScenarioName);
            _customServiceNames = (ServiceNameCollection)info.GetValue(customServiceNamesName, typeof(ServiceNameCollection));

            byte[] channelBindingData = (byte[])info.GetValue(customChannelBindingName, typeof(byte[]));
            if (channelBindingData != null)
            {
                throw new PlatformNotSupportedException();
            }
        }
        public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement,
                                        ChannelBinding customChannelBinding)
        {
            if (policyEnforcement == PolicyEnforcement.Never)
            {
                throw new ArgumentException(SR.GetString(SR.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever), "policyEnforcement");
            }
            if (customChannelBinding == null)
            {
                throw new ArgumentNullException("customChannelBinding");
            }

            this.policyEnforcement = policyEnforcement;
            this.protectionScenario = ProtectionScenario.TransportSelected;
            this.customChannelBinding = customChannelBinding;
        }
Пример #4
0
        public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement,
                                        ChannelBinding customChannelBinding)
        {
            if (policyEnforcement == PolicyEnforcement.Never)
            {
                throw new ArgumentException(SR.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever, nameof(policyEnforcement));
            }

            if (customChannelBinding == null)
            {
                throw new ArgumentNullException(nameof(customChannelBinding));
            }

            _policyEnforcement = policyEnforcement;
            _protectionScenario = ProtectionScenario.TransportSelected;
            _customChannelBinding = customChannelBinding;
        }
        public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement,
                                        ChannelBinding customChannelBinding)
        {
            if (policyEnforcement == PolicyEnforcement.Never)
            {
                throw new ArgumentException(SR.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever, nameof(policyEnforcement));
            }

            if (customChannelBinding == null)
            {
                throw new ArgumentNullException(nameof(customChannelBinding));
            }

            _policyEnforcement    = policyEnforcement;
            _protectionScenario   = ProtectionScenario.TransportSelected;
            _customChannelBinding = customChannelBinding;
        }
        public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, 
                                        ProtectionScenario protectionScenario,
                                        ServiceNameCollection customServiceNames)
        {
            if (policyEnforcement == PolicyEnforcement.Never)
            {
                throw new ArgumentException(SR.GetString(SR.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever), "policyEnforcement");
            }
            if (customServiceNames != null && customServiceNames.Count == 0)
            {
                throw new ArgumentException(SR.GetString(SR.security_ExtendedProtectionPolicy_NoEmptyServiceNameCollection), "customServiceNames");
            }

            this.policyEnforcement = policyEnforcement;
            this.protectionScenario = protectionScenario;
            this.customServiceNames = customServiceNames;
        }
Пример #7
0
        public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement,
                                        ProtectionScenario protectionScenario,
                                        ServiceNameCollection customServiceNames)
        {
            if (policyEnforcement == PolicyEnforcement.Never)
            {
                throw new ArgumentException(SR.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever, nameof(policyEnforcement));
            }

            if (customServiceNames != null && customServiceNames.Count == 0)
            {
                throw new ArgumentException(SR.security_ExtendedProtectionPolicy_NoEmptyServiceNameCollection, nameof(customServiceNames));
            }

            _policyEnforcement = policyEnforcement;
            _protectionScenario = protectionScenario;
            _customServiceNames = customServiceNames;
        }
        public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement,
                                        ProtectionScenario protectionScenario,
                                        ServiceNameCollection customServiceNames)
        {
            if (policyEnforcement == PolicyEnforcement.Never)
            {
                throw new ArgumentException(SR.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever, nameof(policyEnforcement));
            }

            if (customServiceNames != null && customServiceNames.Count == 0)
            {
                throw new ArgumentException(SR.security_ExtendedProtectionPolicy_NoEmptyServiceNameCollection, nameof(customServiceNames));
            }

            _policyEnforcement  = policyEnforcement;
            _protectionScenario = protectionScenario;
            _customServiceNames = customServiceNames;
        }
Пример #9
0
        public ExtendedProtectionPolicyHelper(ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)
        {
            _protectionScenario = DefaultPolicy.ProtectionScenario;
            _policyEnforcement  = DefaultPolicy.PolicyEnforcement;

            _channelBinding        = channelBinding;
            _serviceNameCollection = null;
            _checkServiceBinding   = true;

            if (extendedProtectionPolicy != null)
            {
                _policyEnforcement     = extendedProtectionPolicy.PolicyEnforcement;
                _protectionScenario    = extendedProtectionPolicy.ProtectionScenario;
                _serviceNameCollection = extendedProtectionPolicy.CustomServiceNames;
            }

            if (_policyEnforcement == PolicyEnforcement.Never)
            {
                _checkServiceBinding = false;
            }
        }
		public ExtendedProtectionPolicy (PolicyEnforcement policyEnforcement)
		{
			throw new NotImplementedException ();
		}
Пример #11
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, ChannelBinding customChannelBinding);
Пример #12
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, ProtectionScenario protectionScenario, ServiceNameCollection customServiceNames)
 {
     throw new NotImplementedException();
 }
Пример #13
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, ChannelBinding customChannelBinding)
 {
     throw new NotImplementedException();
 }
Пример #14
0
		public ExtendedProtectionPolicy (PolicyEnforcement policyEnforcement)
		{
			// Do not throw NotImplementedException - System.ServiceModel.Channels.HttpTransportBindingElement tests
			// instantiate this type
		}
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement)
 {
 }
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, ProtectionScenario protectionScenario, System.Collections.ICollection customServiceNames)
 {
 }
Пример #17
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement)
 {
     // This is the only constructor which allows PolicyEnforcement.Never.
     _policyEnforcement = policyEnforcement;
     _protectionScenario = ProtectionScenario.TransportSelected;
 }
        protected ExtendedProtectionPolicy(SerializationInfo info, StreamingContext context)
        {
            policyEnforcement = (PolicyEnforcement)info.GetInt32(policyEnforcementName);
            protectionScenario = (ProtectionScenario)info.GetInt32(protectionScenarioName);
            customServiceNames = (ServiceNameCollection)info.GetValue(customServiceNamesName, typeof(ServiceNameCollection));

            byte[] channelBindingData = (byte[])info.GetValue(customChannelBindingName, typeof(byte[]));
            if (channelBindingData != null)
            {
                customChannelBinding = SafeLocalFreeChannelBinding.LocalAlloc(channelBindingData.Length);
                Marshal.Copy(channelBindingData, 0, customChannelBinding.DangerousGetHandle(), channelBindingData.Length);
            }
        }
Пример #19
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, ProtectionScenario protectionScenario, ServiceNameCollection customServiceNames);
Пример #20
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement)
 {
     throw new NotImplementedException();
 }
		public ExtendedProtectionPolicy (PolicyEnforcement policyEnforcement, ChannelBinding customChannelBinding)
		{
			throw new NotImplementedException ();
		}
		public ExtendedProtectionPolicy (PolicyEnforcement policyEnforcement, ProtectionScenario protectionScenario, ServiceNameCollection customServiceNames)
		{
			throw new NotImplementedException ();
		}
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement, ChannelBinding customChannelBinding)
 {
 }
Пример #24
0
 public ExtendedProtectionPolicy(System.Security.Authentication.ExtendedProtection.PolicyEnforcement policyEnforcement)
 {
     _policyEnforcement  = policyEnforcement;
     _protectionScenario = ExtendedProtection.ProtectionScenario.TransportSelected;
 }
Пример #25
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement)
 {
     PolicyEnforcement = policyEnforcement;
 }
Пример #26
0
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement)
 {
     // Do not throw NotImplementedException - System.ServiceModel.Channels.HttpTransportBindingElement tests
     // instantiate this type
 }
 public ExtendedProtectionPolicy(PolicyEnforcement policyEnforcement)
 {
     // This is the only constructor which allows PolicyEnforcement.Never.
     _policyEnforcement  = policyEnforcement;
     _protectionScenario = ProtectionScenario.TransportSelected;
 }
Пример #28
0
 public ExtendedProtectionPolicy(System.Security.Authentication.ExtendedProtection.PolicyEnforcement policyEnforcement)
 {
     _policyEnforcement = policyEnforcement;
     _protectionScenario = ExtendedProtection.ProtectionScenario.TransportSelected;
 }