/
SafeX509ChainHandle.cs
36 lines (31 loc) · 1.07 KB
/
SafeX509ChainHandle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Security.Cryptography.X509Certificates;
namespace Microsoft.Win32.SafeHandles
{
public sealed class SafeX509ChainHandle : SafeHandleZeroOrMinusOneIsInvalid
{
/// <summary>
/// Creates a <see cref="T:Microsoft.Win32.SafeHandles.SafeX509ChainHandle" />.
/// </summary>
public SafeX509ChainHandle()
: base(true)
{
}
internal static SafeX509ChainHandle InvalidHandle
{
get { return SafeHandleCache<SafeX509ChainHandle>.GetInvalidHandle(() => new SafeX509ChainHandle()); }
}
protected override bool ReleaseHandle()
{
return ChainPal.ReleaseSafeX509ChainHandle(handle);
}
protected override void Dispose(bool disposing)
{
if (!SafeHandleCache<SafeX509ChainHandle>.IsCachedInvalidHandle(this))
{
base.Dispose(disposing);
}
}
}
}