MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-1f15ee7e9f7da02b6bfb4c5a5e6484eb9fa71b82d3699c54bcc7a31794b4a66d/Microsoft/InfoCards/IssuerInformation.cs
2022-08-18 06:28:56 -05:00

73 lines
3.1 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.IssuerInformation
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: ADE0A079-11DB-4A46-8BDE-D2A592CA8DEA
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-1f15ee7e9f7da02b6bfb4c5a5e6484eb9fa71b82d3699c54bcc7a31794b4a66d.exe
using Microsoft.InfoCards.Diagnostics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
namespace Microsoft.InfoCards
{
internal class IssuerInformation
{
private List<IssuerInformationEntry> m_informationEntries;
public IssuerInformation() => this.m_informationEntries = new List<IssuerInformationEntry>();
public void Serialize(Stream stream)
{
BinaryWriter writer = new BinaryWriter(stream, Encoding.Unicode);
writer.Write(this.m_informationEntries.Count);
if (this.m_informationEntries.Count <= 0)
return;
foreach (IssuerInformationEntry informationEntry in this.m_informationEntries)
{
Utility.SerializeString(writer, informationEntry.Name);
Utility.SerializeString(writer, informationEntry.Value);
}
}
public void ReadIssuerInformation(XmlReader reader)
{
if (!reader.IsStartElement(nameof (IssuerInformation), "http://schemas.xmlsoap.org/ws/2007/01/identity"))
throw InfoCardTrace.ThrowHelperError((Exception) new XmlException(SR.GetString("UnexpectedElement")));
while (reader.Read())
{
if ("IssuerInformationEntry" == reader.LocalName && "http://schemas.xmlsoap.org/ws/2007/01/identity" == reader.NamespaceURI)
this.ReadIssuerInformationEntry(reader);
if (nameof (IssuerInformation) == reader.LocalName && "http://schemas.xmlsoap.org/ws/2007/01/identity" == reader.NamespaceURI && XmlNodeType.EndElement == reader.NodeType)
break;
}
}
public void ReadIssuerInformationEntry(XmlReader reader)
{
if (!reader.IsStartElement("IssuerInformationEntry", "http://schemas.xmlsoap.org/ws/2007/01/identity"))
throw InfoCardTrace.ThrowHelperError((Exception) new XmlException(SR.GetString("UnexpectedElement")));
string name = string.Empty;
string str = string.Empty;
while (reader.Read())
{
if ("IssuerInformationEntry" == reader.LocalName && "http://schemas.xmlsoap.org/ws/2007/01/identity" == reader.NamespaceURI && XmlNodeType.EndElement == reader.NodeType)
{
this.m_informationEntries.Add(new IssuerInformationEntry(name, str));
break;
}
if ("EntryName" == reader.LocalName && "http://schemas.xmlsoap.org/ws/2007/01/identity" == reader.NamespaceURI)
{
name = reader.ReadString();
if (string.IsNullOrEmpty(name))
throw InfoCardTrace.ThrowHelperError((Exception) new InvalidCardException());
}
if ("EntryValue" == reader.LocalName && "http://schemas.xmlsoap.org/ws/2007/01/identity" == reader.NamespaceURI)
str = reader.ReadString();
}
}
}
}