File: src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBignumHandle.Unix.cs
Web Access
Project: src\src\libraries\System.Security.Cryptography\src\System.Security.Cryptography.csproj (System.Security.Cryptography)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using System;
using System.Runtime.InteropServices;
using System.Security;
 
namespace Microsoft.Win32.SafeHandles
{
    internal sealed class SafeBignumHandle : SafeHandle
    {
        public SafeBignumHandle() :
            base(IntPtr.Zero, ownsHandle: true)
        {
        }
 
        internal SafeBignumHandle(IntPtr handle, bool ownsHandle)
            : base(handle, ownsHandle)
        {
        }
 
        protected override bool ReleaseHandle()
        {
            Interop.Crypto.BigNumDestroy(handle);
            SetHandle(IntPtr.Zero);
            return true;
        }
 
        public override bool IsInvalid
        {
            get { return handle == IntPtr.Zero; }
        }
    }
}