8 internal static class Crypt32
10 [DllImport(
"crypt32.dll",
CharSet =
CharSet.Unicode, SetLastError =
true)]
61 internal static class SspiCli
63 [StructLayout(
LayoutKind.Sequential, Pack = 1)]
64 internal struct CredHandle
159 internal struct SecBuffer
167 public unsafe
static readonly
int Size =
sizeof(SecBuffer);
170 internal struct SecBufferDesc
186 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
189 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
192 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
195 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
198 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
201 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
204 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
207 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
210 [DllImport(
"sspicli.dll",
CharSet =
CharSet.Unicode, ExactSpelling =
true, SetLastError =
true)]
211 internal unsafe
static extern int AcquireCredentialsHandleW([In]
string principal, [In]
string moduleName, [In]
int usage, [In]
void* logonID, [In]
IntPtr zero, [In]
void* keyCallback, [In]
void* keyArgument, ref
CredHandle handlePtr, out
long timeStamp);
213 [DllImport(
"sspicli.dll",
CharSet =
CharSet.Unicode, ExactSpelling =
true, SetLastError =
true)]
216 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
217 internal unsafe
static extern int InitializeSecurityContextW(ref
CredHandle credentialHandle, [In]
void* inContextPtr, [In]
byte* targetName, [In]
ContextFlags inFlags, [In]
int reservedI, [In]
Endianness endianness, [In]
SecBufferDesc* inputBuffer, [In]
int reservedII, ref
CredHandle outContextPtr, [In][Out] ref
SecBufferDesc outputBuffer, [In][Out] ref
ContextFlags attributes, out
long timeStamp);
219 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
222 [DllImport(
"sspicli.dll", ExactSpelling =
true, SetLastError =
true)]
225 [DllImport(
"sspicli.dll",
CharSet =
CharSet.Unicode, ExactSpelling =
true, SetLastError =
true)]
static bool CertFreeCertificateContext(IntPtr pCertContext)
static SECURITY_STATUS SspiEncodeStringsAsAuthIdentity([In] string userName, [In] string domainName, [In] string password, out System.Net.Security.SafeSspiAuthDataHandle authData)
static unsafe int AcceptSecurityContext(ref CredHandle credentialHandle, [In] void *inContextPtr, [In] SecBufferDesc *inputBuffer, [In] ContextFlags inFlags, [In] Endianness endianness, ref CredHandle outContextPtr, [In][Out] ref SecBufferDesc outputBuffer, [In][Out] ref ContextFlags attributes, out long timeStamp)
static unsafe int AcquireCredentialsHandleW([In] string principal, [In] string moduleName, [In] int usage, [In] void *logonID, [In] System.Net.Security.SafeSspiAuthDataHandle authdata, [In] void *keyCallback, [In] void *keyArgument, ref CredHandle handlePtr, out long timeStamp)
static int FreeContextBuffer([In] IntPtr contextBuffer)
static unsafe int QueryContextAttributesW(ref CredHandle contextHandle, [In] ContextAttribute attribute, [In] void *buffer)
static unsafe int AcquireCredentialsHandleW([In] string principal, [In] string moduleName, [In] int usage, [In] void *logonID, [In] IntPtr zero, [In] void *keyCallback, [In] void *keyArgument, ref CredHandle handlePtr, out long timeStamp)
static SECURITY_STATUS SspiFreeAuthIdentity([In] IntPtr authData)
static unsafe int CompleteAuthToken([In] void *inContextPtr, [In][Out] ref SecBufferDesc inputBuffers)
static unsafe int DecryptMessage([In] ref CredHandle contextHandle, [In][Out] ref SecBufferDesc inputOutput, [In] uint sequenceNumber, uint *qualityOfProtection)
static int EnumerateSecurityPackagesW(out int pkgnum, out System.Net.Security.SafeFreeContextBuffer_SECURITY handle)
static int DeleteSecurityContext(ref CredHandle handlePtr)
static int EncryptMessage(ref CredHandle contextHandle, [In] uint qualityOfProtection, [In][Out] ref SecBufferDesc inputOutput, [In] uint sequenceNumber)
@ InitManualCredValidation
static unsafe int InitializeSecurityContextW(ref CredHandle credentialHandle, [In] void *inContextPtr, [In] byte *targetName, [In] ContextFlags inFlags, [In] int reservedI, [In] Endianness endianness, [In] SecBufferDesc *inputBuffer, [In] int reservedII, ref CredHandle outContextPtr, [In][Out] ref SecBufferDesc outputBuffer, [In][Out] ref ContextFlags attributes, out long timeStamp)
@ SECPKG_ATTR_APPLICATION_PROTOCOL
@ SECPKG_ATTR_CONNECTION_INFO
@ SECPKG_ATTR_CLIENT_CERT_POLICY
@ SECPKG_ATTR_CIPHER_INFO
@ SECPKG_ATTR_CLIENT_SPECIFIED_TARGET
@ SECPKG_ATTR_PACKAGE_INFO
@ SECPKG_ATTR_ISSUER_LIST_EX
@ SECPKG_ATTR_REMOTE_CERT_CONTEXT
@ SECPKG_ATTR_STREAM_SIZES
@ SECPKG_ATTR_UNIQUE_BINDINGS
@ SECPKG_ATTR_ENDPOINT_BINDINGS
@ SECPKG_ATTR_NEGOTIATION_INFO
@ SECPKG_ATTR_LOCAL_CERT_CONTEXT
static int FreeCredentialsHandle(ref CredHandle handlePtr)
@ ApplicationProtocolMismatch
@ NoAuthenticatingAuthority
override string ToString()
unsafe SecBufferDesc(int count)
static unsafe readonly int Size
System.Net.Security.SecurityBufferType BufferType
unsafe override string ToString()
static readonly IntPtr Zero