Add migrated to .NET 8.0 variant of Hcs.Client

This commit is contained in:
2025-09-26 19:48:32 +09:00
parent da127df8f6
commit 6cd2fb82e9
503 changed files with 223796 additions and 0 deletions

View File

@ -0,0 +1,31 @@
using Microsoft.Win32.SafeHandles;
using System;
using System.Security;
namespace GostCryptography.Native
{
/// <summary>
/// Дескриптор функции хэширования криптографического провайдера
/// </summary>
[SecurityCritical]
public class SafeHashHandleImpl : SafeHandleZeroOrMinusOneIsInvalid
{
public static SafeHashHandleImpl InvalidHandle => new SafeHashHandleImpl(IntPtr.Zero);
public SafeHashHandleImpl() : base(true)
{
}
public SafeHashHandleImpl(IntPtr handle) : base(true)
{
SetHandle(handle);
}
[SecurityCritical]
protected override bool ReleaseHandle()
{
CryptoApi.CryptDestroyHash(handle);
return true;
}
}
}