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

68 lines
2.0 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.AsymmetricCryptoSession
// 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 System;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Security.Principal;
namespace Microsoft.InfoCards
{
internal class AsymmetricCryptoSession : CryptoSession
{
private RSACryptoServiceProvider m_provider;
public AsymmetricCryptoSession(
Process process,
DateTime expirationTime,
WindowsIdentity identity,
RSACryptoServiceProvider key)
: base(process, expirationTime, identity, (object) key, CryptoSession.SessionType.Asymmetric)
{
this.m_provider = key;
}
protected override void OnWrite(BinaryWriter bwriter)
{
bwriter.Write(this.m_provider.KeySize);
Utility.SerializeString(bwriter, this.m_provider.KeyExchangeAlgorithm);
Utility.SerializeString(bwriter, this.m_provider.SignatureAlgorithm);
}
protected override void OnDispose()
{
this.m_provider.Clear();
this.m_provider.Dispose();
this.m_provider = (RSACryptoServiceProvider) null;
}
public byte[] Encrypt(bool fOAEP, byte[] inData)
{
this.ThrowIfDisposed();
return this.m_provider.Encrypt(inData, fOAEP);
}
public byte[] Decrypt(bool fOAEP, byte[] inData)
{
this.ThrowIfDisposed();
return this.m_provider.Decrypt(inData, fOAEP);
}
public byte[] SignHash(byte[] hash, string hashAlgOid)
{
this.ThrowIfDisposed();
return this.m_provider.SignHash(hash, hashAlgOid);
}
public bool VerifyHash(byte[] hash, string hashAlgOid, byte[] sig)
{
this.ThrowIfDisposed();
return this.m_provider.VerifyHash(hash, hashAlgOid, sig);
}
}
}