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,36 @@
using Microsoft.Win32.SafeHandles;
using System;
using System.Security;
namespace GostCryptography.Native
{
/// <summary>
/// Дескриптор ключа криптографического провайдера
/// </summary>
[SecurityCritical]
public sealed class SafeKeyHandleImpl : SafeHandleZeroOrMinusOneIsInvalid
{
public SafeKeyHandleImpl()
: base(true)
{
}
public SafeKeyHandleImpl(IntPtr handle)
: base(true)
{
SetHandle(handle);
}
public static SafeKeyHandleImpl InvalidHandle
{
get { return new SafeKeyHandleImpl(IntPtr.Zero); }
}
[SecurityCritical]
protected override bool ReleaseHandle()
{
CryptoApi.CryptDestroyKey(handle);
return true;
}
}
}