diff --git a/Contexts/SafeContextHandle.cs b/Contexts/SafeContextHandle.cs
new file mode 100644
index 0000000..393056e
--- /dev/null
+++ b/Contexts/SafeContextHandle.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace NSspi.Contexts
+{
+
+ public class SafeContextHandle : SafeSspiHandle
+ {
+ public SafeContextHandle()
+ : base()
+ { }
+
+ protected override bool ReleaseHandle()
+ {
+ SecurityStatus status = ContextNativeMethods.DeleteSecurityContext(
+ ref base.rawHandle
+ );
+
+ base.ReleaseHandle();
+
+ return status == SecurityStatus.OK;
+ }
+ }
+}
diff --git a/Credentials/SafeCredentialHandle.cs b/Credentials/SafeCredentialHandle.cs
new file mode 100644
index 0000000..e6dfa93
--- /dev/null
+++ b/Credentials/SafeCredentialHandle.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace NSspi.Credentials
+{
+
+ public class SafeCredentialHandle : SafeSspiHandle
+ {
+ public SafeCredentialHandle()
+ : base()
+ { }
+
+ protected override bool ReleaseHandle()
+ {
+ SecurityStatus status = CredentialNativeMethods.FreeCredentialsHandle(
+ ref base.rawHandle
+ );
+
+ base.ReleaseHandle();
+
+ return status == SecurityStatus.OK;
+ }
+ }
+
+}
diff --git a/NSspi.csproj b/NSspi.csproj
index e0d5087..cb53f2e 100644
--- a/NSspi.csproj
+++ b/NSspi.csproj
@@ -53,6 +53,7 @@
+
@@ -62,6 +63,7 @@
+
diff --git a/SspiHandle.cs b/SspiHandle.cs
index 99c213c..6a9c14f 100644
--- a/SspiHandle.cs
+++ b/SspiHandle.cs
@@ -66,40 +66,4 @@ namespace NSspi
return true;
}
}
-
- public class SafeCredentialHandle : SafeSspiHandle
- {
- public SafeCredentialHandle()
- : base()
- { }
-
- protected override bool ReleaseHandle()
- {
- SecurityStatus status = CredentialNativeMethods.FreeCredentialsHandle(
- ref base.rawHandle
- );
-
- base.ReleaseHandle();
-
- return status == SecurityStatus.OK;
- }
- }
-
- public class SafeContextHandle : SafeSspiHandle
- {
- public SafeContextHandle()
- : base()
- { }
-
- protected override bool ReleaseHandle()
- {
- SecurityStatus status = ContextNativeMethods.DeleteSecurityContext(
- ref base.rawHandle
- );
-
- base.ReleaseHandle();
-
- return status == SecurityStatus.OK;
- }
- }
}