// Decompiled with JetBrains decompiler // Type: Microsoft.InfoCards.RemoteX509AsymmetricSecurityKey // Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // MVID: 1D4D5564-A025-490C-AF1D-DF4FBB709D1F // Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Virus.Win32.Expiro.w-f8f9f26e940480624825f6bddbea86e70fc4aa746c4dd8efa7d98dcb477000ed.exe using Microsoft.InfoCards.Diagnostics; using System; using System.IdentityModel.Tokens; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; namespace Microsoft.InfoCards { internal class RemoteX509AsymmetricSecurityKey : X509AsymmetricSecurityKey, IDisposable { private X509Certificate2 m_cert; private object m_sync; private bool m_disposed; public RemoteX509AsymmetricSecurityKey(X509Certificate2 cert) : base(cert) { this.m_cert = cert; if (!(this.m_cert.PrivateKey is RemoteCryptoRsaServiceProvider)) throw InfoCardTrace.ThrowHelperError((Exception) new NotSupportedException()); this.m_sync = new object(); } public override AsymmetricAlgorithm GetAsymmetricAlgorithm( string algorithmUri, bool privateKey) { return this.IsSupportedAlgorithm(algorithmUri) ? base.GetAsymmetricAlgorithm(algorithmUri, privateKey) : throw InfoCardTrace.ThrowHelperError((Exception) new NotSupportedException()); } public override AsymmetricSignatureDeformatter GetSignatureDeformatter( string algorithmUri) { return this.IsSupportedAlgorithm(algorithmUri) ? base.GetSignatureDeformatter(algorithmUri) : throw InfoCardTrace.ThrowHelperError((Exception) new NotSupportedException()); } public override AsymmetricSignatureFormatter GetSignatureFormatter( string algorithmUri) { if (!this.IsSupportedAlgorithm(algorithmUri)) throw InfoCardTrace.ThrowHelperError((Exception) new NotSupportedException()); RemoteAsymmetricSignatureFormatter signatureFormatter = new RemoteAsymmetricSignatureFormatter(); signatureFormatter.SetKey(this.m_cert.PrivateKey); return (AsymmetricSignatureFormatter) signatureFormatter; } public override bool IsSupportedAlgorithm(string algorithmUri) { switch (algorithmUri) { case "http://www.w3.org/2000/09/xmldsig#rsa-sha1": case "http://www.w3.org/2001/04/xmlenc#rsa-1_5": case "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p": return base.IsSupportedAlgorithm(algorithmUri); default: return false; } } void IDisposable.Dispose() { if (this.m_disposed) return; lock (this.m_sync) { if (this.m_disposed) return; this.m_disposed = true; this.m_cert.PrivateKey?.Dispose(); this.m_cert.PublicKey.Key?.Dispose(); } } } }