mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 11:26:11 +00:00
f2ac1ece55
add
69 lines
2.1 KiB
C#
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: 516D8B44-4448-4D2C-8B8E-FFBB3FFE472B
|
|
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Virus.Win32.Expiro.w-69bb73081eac86b8cf86f45e33515d0095855636967076e2b593d7a30cd80a07.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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|