mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-22 19:36:11 +00:00
f2ac1ece55
add
51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Microsoft.InfoCards.RemoteCryptoTokenProvider
|
|
// 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;
|
|
using System.IdentityModel.Selectors;
|
|
using System.IdentityModel.Tokens;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
|
|
namespace Microsoft.InfoCards
|
|
{
|
|
internal sealed class RemoteCryptoTokenProvider : SecurityTokenProvider, IDisposable
|
|
{
|
|
private RemoteX509Token m_token;
|
|
private X509Certificate2 m_certificate;
|
|
private object m_sync;
|
|
|
|
public RemoteCryptoTokenProvider(X509Certificate2 cert)
|
|
{
|
|
this.m_sync = new object();
|
|
this.m_certificate = cert;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
IDisposable token = (IDisposable) this.m_token;
|
|
if (token == null)
|
|
return;
|
|
token.Dispose();
|
|
this.m_token = (RemoteX509Token) null;
|
|
}
|
|
|
|
protected override SecurityToken GetTokenCore(TimeSpan timeout) => (SecurityToken) this.InnerGetToken();
|
|
|
|
private X509SecurityToken InnerGetToken()
|
|
{
|
|
if (this.m_token == null)
|
|
{
|
|
lock (this.m_sync)
|
|
{
|
|
if (this.m_token == null)
|
|
this.m_token = new RemoteX509Token(this.m_certificate);
|
|
}
|
|
}
|
|
return (X509SecurityToken) this.m_token;
|
|
}
|
|
}
|
|
}
|