Add project

Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
2025-08-12 11:21:10 +09:00
parent bbcbe841a7
commit 33ab055b43
546 changed files with 176950 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;
}
}
}