本文整理汇总了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;
}
示例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;
}