Added support for querying the context's user name and authority. Still working my way up to EncryptMessage.

This commit is contained in:
antiduh
2014-06-23 18:30:26 +00:00
parent 1be2b9c7ef
commit 9785183f31
6 changed files with 215 additions and 2 deletions

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace NSspi.Contexts
{
[StructLayout( LayoutKind.Sequential )]
public struct SecPkgContext_Sizes
{
public int MaxToken;
public int MaxSignature;
public int BlockSize;
public int SecurityTrailer;
}
[StructLayout( LayoutKind.Sequential )]
public struct SecPkgContext_String
{
public IntPtr StringResult;
}
public class ContextQueryHandle : SafeHandle
{
public ContextQueryHandle() :
base( IntPtr.Zero, true )
{
}
public override bool IsInvalid
{
get { return base.handle.Equals( IntPtr.Zero ); }
}
protected override bool ReleaseHandle()
{
return ContextNativeMethods.FreeContextBuffer( base.handle ) == SecurityStatus.OK;
}
}
}