• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ProtectionLevel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ProtectionLevel的典型用法代码示例。如果您正苦于以下问题:C# ProtectionLevel类的具体用法?C# ProtectionLevel怎么用?C# ProtectionLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProtectionLevel类属于命名空间,在下文中一共展示了ProtectionLevel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AuthenticateAsClient

 //
 public virtual void AuthenticateAsClient( NetworkCredential       credential,
                                         string                  targetName,
                                         ProtectionLevel         requiredProtectionLevel,   //this will be the ultimate result or exception
                                         TokenImpersonationLevel allowedImpersonationLevel) //this OR LOWER will be ultimate result in auth context
 {
     AuthenticateAsClient(credential, null, targetName, requiredProtectionLevel, allowedImpersonationLevel);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:8,代码来源:NegotiateStream.cs


示例2: ValidateCreateContext

        internal void ValidateCreateContext(
            string package,
            NetworkCredential credential,
            string servicePrincipalName,
            ExtendedProtectionPolicy policy,
            ProtectionLevel protectionLevel,
            TokenImpersonationLevel impersonationLevel)
        {
            if (policy != null)
            {
                // One of these must be set if EP is turned on
                if (policy.CustomChannelBinding == null && policy.CustomServiceNames == null)
                {
                    throw new ArgumentException(SR.net_auth_must_specify_extended_protection_scheme, nameof(policy));
                }

                _extendedProtectionPolicy = policy;
            }
            else
            {
                _extendedProtectionPolicy = new ExtendedProtectionPolicy(PolicyEnforcement.Never);
            }

            ValidateCreateContext(package, true, credential, servicePrincipalName, _extendedProtectionPolicy.CustomChannelBinding, protectionLevel, impersonationLevel);
        }
开发者ID:shiftkey-tester,项目名称:corefx,代码行数:25,代码来源:NegoState.Windows.cs


示例3: MsmqTransportSecurity

 public MsmqTransportSecurity()
 {
     this.msmqAuthenticationMode = System.ServiceModel.MsmqAuthenticationMode.WindowsDomain;
     this.msmqEncryptionAlgorithm = System.ServiceModel.MsmqEncryptionAlgorithm.RC4Stream;
     this.msmqHashAlgorithm = System.ServiceModel.MsmqSecureHashAlgorithm.Sha1;
     this.msmqProtectionLevel = ProtectionLevel.Sign;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:MsmqTransportSecurity.cs


示例4: TcpTransportSecurity

 public TcpTransportSecurity()
 {
     this.clientCredentialType = DefaultClientCredentialType;
     this.protectionLevel = DefaultProtectionLevel;
     this.extendedProtectionPolicy = ChannelBindingUtility.DefaultPolicy;
     this.sslProtocols = TransportDefaults.SslProtocols;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:TcpTransportSecurity.cs


示例5: MsmqTransportSecurity

 public MsmqTransportSecurity()
 {
     this.msmqAuthenticationMode = MsmqDefaults.MsmqAuthenticationMode;
     this.msmqEncryptionAlgorithm = MsmqDefaults.MsmqEncryptionAlgorithm;
     this.msmqHashAlgorithm = MsmqDefaults.MsmqSecureHashAlgorithm;
     this.msmqProtectionLevel = MsmqDefaults.MsmqProtectionLevel;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:MsmqTransportSecurity.cs


示例6: BindingProperties

        public BindingProperties(SecurityMode securityMode, MessageCredentialType messageCredentialType, 
            TcpClientCredentialType tcpClientCredentialType, ProtectionLevel protectionLevel,
            int maxConnections, long maxReceivedMessageSize, long maxBufferPoolSize, int maxArrayLength, 
            int maxBytesPerRead, int maxDepth, int maxStringContentLength, int maxBufferSize,
            TimeSpan openTimeout, TimeSpan closeTimeout, TimeSpan receiveTimeout, TimeSpan sendTimeout)
        {
            m_SecurityMode = securityMode;
            m_MessageCredentialType = messageCredentialType;
            m_TcpClientCredentialType = tcpClientCredentialType;
            m_ProtectionLevel = protectionLevel;

            m_MaxConnections = maxConnections;
            m_MaxReceivedMessageSize = maxReceivedMessageSize;
            m_MaxBufferPoolSize = maxBufferPoolSize;
            m_MaxArrayLength = maxArrayLength;
            m_MaxBytesPerRead = maxBytesPerRead;
            m_MaxDepth = maxDepth;
            m_MaxStringContentLength = maxStringContentLength;
            m_MaxBufferSize = maxBufferSize;

            m_OpenTimeout = openTimeout;
            m_CloseTimeout = closeTimeout;
            m_ReceiveTimeout = receiveTimeout;
            m_SendTimeout = sendTimeout;
        }
开发者ID:JackFong,项目名称:GenericWcfServiceHostAndClient,代码行数:25,代码来源:BindingTypes.cs


示例7: WindowsStreamSecurityUpgradeProvider

        public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
            BindingContext context, bool isClient)
            : base(context.Binding)
        {
            this.extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
            this.protectionLevel = bindingElement.ProtectionLevel;
            this.scheme = context.Binding.Scheme;
            this.isClient = isClient;
            this.listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);

            SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();
            if (credentialProvider == null)
            {
                if (isClient)
                {
                    credentialProvider = ClientCredentials.CreateDefaultCredentials();
                }
                else
                {
                    credentialProvider = ServiceCredentials.CreateDefaultCredentials();
                }
            }


            this.securityTokenManager = credentialProvider.CreateSecurityTokenManager();
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:26,代码来源:WindowsStreamSecurityUpgradeProvider.cs


示例8: WindowsStreamSecurityUpgradeProvider

        public WindowsStreamSecurityUpgradeProvider(WindowsStreamSecurityBindingElement bindingElement,
            BindingContext context, bool isClient)
            : base(context.Binding)
        {
            _extractGroupsForWindowsAccounts = TransportDefaults.ExtractGroupsForWindowsAccounts;
            _protectionLevel = bindingElement.ProtectionLevel;
            _scheme = context.Binding.Scheme;
            _isClient = isClient;
            _listenUri = TransportSecurityHelpers.GetListenUri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);

            SecurityCredentialsManager credentialProvider = context.BindingParameters.Find<SecurityCredentialsManager>();

            if (credentialProvider == null)
            {
                if (isClient)
                {
                    credentialProvider = ClientCredentials.CreateDefaultCredentials();
                }
                else
                {
                    throw ExceptionHelper.PlatformNotSupported("WindowsStreamSecurityUpgradeProvider for server is not supported.");
                }
            }

            _securityTokenManager = credentialProvider.CreateSecurityTokenManager();
        }
开发者ID:shijiaxing,项目名称:wcf,代码行数:26,代码来源:WindowsStreamSecurityUpgradeProvider.cs


示例9: SecurityCapabilities

 public SecurityCapabilities(bool supportsClientAuth, bool supportsServerAuth, bool supportsClientWindowsIdentity, ProtectionLevel requestProtectionLevel, ProtectionLevel responseProtectionLevel)
 {
     this.supportsClientAuth = supportsClientAuth;
     this.supportsServerAuth = supportsServerAuth;
     this.supportsClientWindowsIdentity = supportsClientWindowsIdentity;
     this.requestProtectionLevel = requestProtectionLevel;
     this.responseProtectionLevel = responseProtectionLevel;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SecurityCapabilities.cs


示例10: WSHttpContextBinding

 private WSHttpContextBinding(WSHttpBinding wsHttpBinding)
 {
     this.contextProtectionLevel = ProtectionLevel.Sign;
     this.contextManagementEnabled = true;
     WSHttpContextBindingPropertyTransferHelper helper = new WSHttpContextBindingPropertyTransferHelper();
     helper.InitializeFrom(wsHttpBinding);
     helper.SetBindingElementType(typeof(WSHttpContextBinding));
     helper.ApplyConfiguration(this);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:WSHttpContextBinding.cs


示例11: ValidateCreateContext

 internal void ValidateCreateContext(string package,
                                     NetworkCredential credential,
                                     string servicePrincipalName,
                                     ExtendedProtectionPolicy policy,
                                     ProtectionLevel protectionLevel,
                                     TokenImpersonationLevel impersonationLevel)
 {
     throw new PlatformNotSupportedException();
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:9,代码来源:NegoState.Unix.cs


示例12: NetTcpContextBinding

 private NetTcpContextBinding(NetTcpBinding netTcpBinding)
 {
     this.contextManagementEnabled = true;
     this.contextProtectionLevel = ProtectionLevel.Sign;
     NetTcpContextBindingPropertyTransferHelper helper = new NetTcpContextBindingPropertyTransferHelper();
     helper.InitializeFrom(netTcpBinding);
     helper.SetBindingElementType(typeof(NetTcpContextBinding));
     helper.ApplyConfiguration(this);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:NetTcpContextBinding.cs


示例13: ChannelProtectionRequirements

        internal ChannelProtectionRequirements(ChannelProtectionRequirements other, ProtectionLevel newBodyProtectionLevel)
        {
            if (other == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("other"));

            _incomingSignatureParts = new ScopedMessagePartSpecification(other._incomingSignatureParts, newBodyProtectionLevel != ProtectionLevel.None);
            _incomingEncryptionParts = new ScopedMessagePartSpecification(other._incomingEncryptionParts, newBodyProtectionLevel == ProtectionLevel.EncryptAndSign);
            _outgoingSignatureParts = new ScopedMessagePartSpecification(other._outgoingSignatureParts, newBodyProtectionLevel != ProtectionLevel.None);
            _outgoingEncryptionParts = new ScopedMessagePartSpecification(other._outgoingEncryptionParts, newBodyProtectionLevel == ProtectionLevel.EncryptAndSign);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:10,代码来源:ChannelProtectionRequirements.cs


示例14: SetProtectionLevel

      void SetProtectionLevel(ProtectionLevel protectionLevel)
      {
         m_NonProtectionRadioButton.Enabled = true;
         m_SignedRadioButton.Enabled = true;
         m_EncryptRadioButton.Enabled = true;

         m_NonProtectionRadioButton.Checked = protectionLevel == ProtectionLevel.None;
         m_SignedRadioButton.Checked = protectionLevel == ProtectionLevel.Sign;
         m_EncryptRadioButton.Checked = protectionLevel == ProtectionLevel.EncryptAndSign;
      }
开发者ID:ittray,项目名称:LocalDemo,代码行数:10,代码来源:ContractViewControl.cs


示例15: protectionLevel

 public static HtmlBuilder protectionLevel(this HtmlBuilder builder, ProtectionLevel plevel)
 {
     switch (plevel)
     {
         case ProtectionLevel.PRIVATE: return builder.text("private");
         case ProtectionLevel.INTERNAL: return builder.text("internal"); ;
         case ProtectionLevel.PROTECTED: return builder.text("protected");
         default:
         case ProtectionLevel.PUBLIC: return builder.text("public");
     }
 }
开发者ID:codaxy,项目名称:dox,代码行数:11,代码来源:HtmlBuilderExtensions.cs


示例16: BeginAuthenticateAsClient

 private IAsyncResult BeginAuthenticateAsClient(
     NetworkCredential credential,
     string targetName,
     ProtectionLevel requiredProtectionLevel,
     TokenImpersonationLevel allowedImpersonationLevel,
     AsyncCallback asyncCallback,
     object asyncState)
 {
     return BeginAuthenticateAsClient(credential, null, targetName,
                                      requiredProtectionLevel, allowedImpersonationLevel,
                                      asyncCallback, asyncState);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:12,代码来源:NegotiateStream.cs


示例17: TcpServerChannel

 public TcpServerChannel(int port)
 {
     this._channelPriority = 1;
     this._channelName = "tcp";
     this._port = -1;
     this._bUseIpAddress = true;
     this._bindToAddr = Socket.OSSupportsIPv4 ? IPAddress.Any : IPAddress.IPv6Any;
     this._protectionLevel = ProtectionLevel.EncryptAndSign;
     this._bExclusiveAddressUse = true;
     this._port = port;
     this.SetupMachineName();
     this.SetupChannel();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:TcpServerChannel.cs


示例18: MessagePartDescription

 // Methods
 internal MessagePartDescription(MessagePartDescription other)
 {
     this.name = other.name;
     this.ns = other.ns;
     this.index = other.index;
     this.type = other.type;
     this.serializationPosition = other.serializationPosition;
     this.hasProtectionLevel = other.hasProtectionLevel;
     this.protectionLevel = other.protectionLevel;
     this.memberInfo = other.memberInfo;
     this.multiple = other.multiple;
     this.additionalAttributesProvider = other.additionalAttributesProvider;
     this.baseType = other.baseType;
     this.uniquePartName = other.uniquePartName;
 }
开发者ID:gtri-iead,项目名称:LEXS-NET-Sample-Implementation-3.1.4,代码行数:16,代码来源:MessagePartDescription.cs


示例19: MessagePartDescription

 internal MessagePartDescription(MessagePartDescription other)
 {
     _name = other._name;
     _ns = other._ns;
     _index = other._index;
     _type = other._type;
     _serializationPosition = other._serializationPosition;
     _hasProtectionLevel = other._hasProtectionLevel;
     _protectionLevel = other._protectionLevel;
     _memberInfo = other._memberInfo;
     _multiple = other._multiple;
     _additionalAttributesProvider = other._additionalAttributesProvider;
     _baseType = other._baseType;
     _uniquePartName = other._uniquePartName;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:15,代码来源:MessagePartDescription.cs


示例20: EnterXPSendLock

 internal static void EnterXPSendLock(out bool lockHeld, ProtectionLevel protectionLevel)
 {
     lockHeld = false;
     if ((xpSendLock != null) && (protectionLevel != ProtectionLevel.None))
     {
         try
         {
         }
         finally
         {
             Monitor.Enter(xpSendLock);
             lockHeld = true;
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:Msmq.cs



注:本文中的ProtectionLevel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ProtectionParameters类代码示例发布时间:2022-05-24
下一篇:
C# Props类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap