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

73 lines
3.1 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.IssuerInformation
// 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 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();
}
}
}
}