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

69 lines
2.1 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.X509CertificateTokenFactoryCredential
// 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 System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace Microsoft.InfoCards
{
internal class X509CertificateTokenFactoryCredential : TokenFactoryCredential
{
private X509Certificate2 m_cert;
private string m_contextKey;
private string m_portName;
private UIAgentRequest m_request;
private bool m_disposed;
private object m_sync = new object();
public X509CertificateTokenFactoryCredential(UIAgentRequest request)
: base(TokenFactoryCredentialType.X509CertificateCredential)
{
this.m_request = request;
}
public string ContextKey => this.m_contextKey;
public string PortName => this.m_portName;
public X509Certificate2 Certificate => this.m_cert;
protected override void DeserializeData(BinaryReader reader)
{
this.m_portName = Utility.DeserializeString(reader);
this.m_contextKey = Utility.DeserializeString(reader);
byte[] numArray = new byte[reader.ReadInt32()];
reader.Read(numArray, 0, numArray.Length);
this.m_cert = new X509Certificate2(numArray);
this.m_cert.PrivateKey = (AsymmetricAlgorithm) new RemoteCryptoRsaServiceProvider(this, this.m_request);
}
public override void Dispose(bool disposing)
{
if (this.m_disposed)
return;
lock (this.m_sync)
{
if (this.m_disposed)
return;
try
{
if (disposing)
{
this.m_cert.PrivateKey.Clear();
this.m_cert.PublicKey.Key.Clear();
}
this.m_disposed = true;
}
finally
{
base.Dispose(disposing);
}
}
}
}
}