.NET Framework では、独自の暗号アルゴリズムを作成する必要がある場合、次のような独自のクラスを作成できます。
public class MyAlgorithm: System.Security.Cryptography.HashAlgorithm
{
}
しかし、.NET Core では非常に制限されているようです。
public abstract class HashAlgorithm : IDisposable
{
protected HashAlgorithm();
public virtual int HashSize { get; }
public byte[] ComputeHash(byte[] buffer);
public byte[] ComputeHash(byte[] buffer, int offset, int count);
public byte[] ComputeHash(Stream inputStream);
public void Dispose();
public abstract void Initialize();
protected virtual void Dispose(bool disposing);
protected abstract void HashCore(byte[] array, int ibStart, int cbSize);
protected abstract byte[] HashFinal();
}
HashSizeValue
やなどはありませんState
。
HashAlgorithm
.NET Core で独自のアルゴリズムの基本クラスとして引き続き使用する必要がありますか?