当前位置: 首页>>代码示例>>C#>>正文


C# SecurityBindingElement.IsSetKeyDerivation方法代码示例

本文整理汇总了C#中SecurityBindingElement.IsSetKeyDerivation方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityBindingElement.IsSetKeyDerivation方法的具体用法?C# SecurityBindingElement.IsSetKeyDerivation怎么用?C# SecurityBindingElement.IsSetKeyDerivation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecurityBindingElement的用法示例。


在下文中一共展示了SecurityBindingElement.IsSetKeyDerivation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryCreate

 internal static bool TryCreate(SecurityBindingElement sbe, out BasicHttpMessageSecurity security, out bool isSecureTransportMode)
 {
     BasicHttpMessageCredentialType userName;
     security = null;
     isSecureTransportMode = false;
     if (!sbe.DoNotEmitTrust)
     {
         return false;
     }
     if (!sbe.IsSetKeyDerivation(false))
     {
         return false;
     }
     if (sbe.SecurityHeaderLayout != SecurityHeaderLayout.Lax)
     {
         return false;
     }
     if (sbe.MessageSecurityVersion != MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10)
     {
         return false;
     }
     if (!SecurityBindingElement.IsMutualCertificateBinding(sbe, true))
     {
         isSecureTransportMode = true;
         if (!SecurityBindingElement.IsCertificateOverTransportBinding(sbe))
         {
             if (!SecurityBindingElement.IsUserNameOverTransportBinding(sbe))
             {
                 return false;
             }
             userName = BasicHttpMessageCredentialType.UserName;
         }
         else
         {
             userName = BasicHttpMessageCredentialType.Certificate;
         }
     }
     else
     {
         userName = BasicHttpMessageCredentialType.Certificate;
     }
     security = new BasicHttpMessageSecurity();
     security.ClientCredentialType = userName;
     security.AlgorithmSuite = sbe.DefaultAlgorithmSuite;
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:46,代码来源:BasicHttpMessageSecurity.cs

示例2: TryCreate

        // This method reverses the CreateMessageSecurity(bool) method
        internal static bool TryCreate(SecurityBindingElement sbe, out BasicHttpMessageSecurity security, out bool isSecureTransportMode)
        {
            Fx.Assert(null != sbe, string.Empty);

            security = null;
            isSecureTransportMode = false;

            if (!sbe.IsSetKeyDerivation(false))
                return false;
            if (sbe.SecurityHeaderLayout != SecurityHeaderLayout.Lax)
                return false;
            if (sbe.MessageSecurityVersion != MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10)
                return false;

            BasicHttpMessageCredentialType credentialType;
            if (!SecurityBindingElement.IsMutualCertificateBinding(sbe, true))
            {
                isSecureTransportMode = true;
                if (SecurityBindingElement.IsCertificateOverTransportBinding(sbe))
                {
                    credentialType = BasicHttpMessageCredentialType.Certificate;
                }
                else if (SecurityBindingElement.IsUserNameOverTransportBinding(sbe))
                {
                    credentialType = BasicHttpMessageCredentialType.UserName;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                credentialType = BasicHttpMessageCredentialType.Certificate;
            }
            security = new BasicHttpMessageSecurity();
            security.ClientCredentialType = credentialType;

            return true;
        }
开发者ID:dmetzgar,项目名称:wcf,代码行数:41,代码来源:BasicHttpMessageSecurity.cs


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