MalwareSourceCode/MSIL/Virus/Win32/E/Virus.Win32.Expiro.w-67b630ead60119692b9abbdfd8717c96904ef041127c2cae033c86b718eaa61e/Microsoft/InfoCards/TokenFactoryCredential.cs

88 lines
2.6 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.TokenFactoryCredential
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: ADE0A079-11DB-4A46-8BDE-D2A592CA8DEA
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-67b630ead60119692b9abbdfd8717c96904ef041127c2cae033c86b718eaa61e.exe
using Microsoft.InfoCards.Diagnostics;
using System;
using System.IO;
namespace Microsoft.InfoCards
{
internal abstract class TokenFactoryCredential : IDisposable
{
public const int NoCredential = -1;
private TokenFactoryCredentialType m_type;
private Uri m_cardId;
private int m_paramIndex;
private int m_lcid;
protected TokenFactoryCredential(TokenFactoryCredentialType type) => this.m_type = type;
public void Dispose() => this.Dispose(true);
public virtual void Dispose(bool disposing)
{
}
public static TokenFactoryCredential CreateFrom(
BinaryReader reader,
UIAgentRequest request,
int lcid)
{
TokenFactoryCredential from;
switch (reader.ReadInt32())
{
case -1:
from = (TokenFactoryCredential) null;
break;
case 1:
from = (TokenFactoryCredential) new UserNameTokenFactoryCredential();
from.Deserialize(reader);
break;
case 2:
from = (TokenFactoryCredential) new SelfIssuedTokenFactoryCredential();
from.Deserialize(reader);
break;
case 3:
from = (TokenFactoryCredential) new X509CertificateTokenFactoryCredential(request);
from.Deserialize(reader);
break;
case 4:
from = (TokenFactoryCredential) new KerberosTokenFactoryCredential();
from.Deserialize(reader);
break;
default:
InfoCardTrace.ThrowInvalidArgumentConditional(true, "CredentialType");
from = (TokenFactoryCredential) null;
break;
}
if (from != null)
from.LCID = lcid;
return from;
}
public int ParameterIndex => this.m_paramIndex;
public TokenFactoryCredentialType CredentialType => this.m_type;
public int LCID
{
get => this.m_lcid;
set => this.m_lcid = value;
}
public Uri CardId => this.m_cardId;
private void Deserialize(BinaryReader reader)
{
this.m_cardId = new Uri(Utility.DeserializeString(reader));
this.m_paramIndex = reader.ReadInt32();
this.DeserializeData(reader);
}
protected abstract void DeserializeData(BinaryReader reader);
}
}