MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07/Microsoft/InfoCards/ProtocolProfile.cs

65 lines
2.9 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.ProtocolProfile
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 516D8B44-4448-4D2C-8B8E-FFBB3FFE472B
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07.exe
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Security;
namespace Microsoft.InfoCards
{
internal class ProtocolProfile
{
private XmlNames.IWSTrust m_iWSTrust = (XmlNames.IWSTrust) XmlNames.WSTrustXmlSoap2005.Instance;
private XmlNames.IWSPolicy m_iWSPolicy = (XmlNames.IWSPolicy) XmlNames.WSPolicyXmlSoap2004.Instance;
private static WSSecurityTokenSerializer s_tokenSerializerDefault = new WSSecurityTokenSerializer(MessageSecurityVersion.Default.SecurityVersion, true);
private static WSSecurityTokenSerializer s_tokenSerializerWSTrust13 = new WSSecurityTokenSerializer(SecurityVersion.WSSecurity11, TrustVersion.WSTrust13, SecureConversationVersion.WSSecureConversation13, false, (SamlSerializer) null, (SecurityStateEncoder) null, (IEnumerable<Type>) null);
public XmlNames.IWSTrust WSTrust
{
get => this.m_iWSTrust;
set => this.m_iWSTrust = value;
}
public XmlNames.IWSPolicy WSPolicy => this.m_iWSPolicy;
public MessageSecurityVersion MsgSecurityVersion
{
get
{
if (XmlNames.WSSpecificationVersion.WSTrustXmlSoap2005 == this.WSTrust.Version)
return MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11;
return XmlNames.WSSpecificationVersion.WSTrustOasis2007 == this.WSTrust.Version ? MessageSecurityVersion.WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12 : MessageSecurityVersion.Default;
}
}
public WSSecurityTokenSerializer TokenSerializer => XmlNames.WSSpecificationVersion.WSTrustOasis2007 == this.WSTrust.Version ? ProtocolProfile.s_tokenSerializerWSTrust13 : ProtocolProfile.s_tokenSerializerDefault;
public ProtocolProfile()
{
}
public ProtocolProfile(string policyXml)
{
if (policyXml.Contains(XmlNames.WSTrustXmlSoap2005.Instance.Namespace))
this.m_iWSTrust = (XmlNames.IWSTrust) XmlNames.WSTrustXmlSoap2005.Instance;
else if (policyXml.Contains(XmlNames.WSTrustOasis2007.Instance.Namespace))
this.m_iWSTrust = (XmlNames.IWSTrust) XmlNames.WSTrustOasis2007.Instance;
if (policyXml.Contains(XmlNames.WSPolicyXmlSoap2004.Instance.Namespace))
{
this.m_iWSPolicy = (XmlNames.IWSPolicy) XmlNames.WSPolicyXmlSoap2004.Instance;
}
else
{
if (!policyXml.Contains(XmlNames.WSPolicyW32007.Instance.Namespace))
return;
this.m_iWSPolicy = (XmlNames.IWSPolicy) XmlNames.WSPolicyW32007.Instance;
}
}
}
}