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

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: ADE0A079-11DB-4A46-8BDE-D2A592CA8DEA
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-1f15ee7e9f7da02b6bfb4c5a5e6484eb9fa71b82d3699c54bcc7a31794b4a66d.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;
}
}
}