public unsafe static void EncryptMessage( ref SafeCtxtHandle context, ref SecBufferDescEx message, uint MessageSeqNo, void *pfQOP) { try { message.Pin(); int error = Secur32Dll.EncryptMessage( ref context.Handle, pfQOP, ref message.SecBufferDesc, MessageSeqNo); if (error != 0) { throw new SspiException(error, @"EncryptMessage"); } } finally { message.Free(); } }
public unsafe static SecurityStatus SafeVerifySignature( SafeCtxtHandle context, ref SecBufferDescEx message, int sequence) { try { message.Pin(); int qop; var error = Secur32Dll.VerifySignature( ref context.Handle, ref message.SecBufferDesc, sequence, out qop); return(Convert(error)); } catch { return(SecurityStatus.SEC_E_UNKNOW_ERROR); } finally { message.Free(); } }
public unsafe static SecurityStatus SafeDecryptMessage( ref SafeCtxtHandle context, ref SecBufferDescEx message, uint MessageSeqNo, void *pfQOP) { try { message.Pin(); int error = Secur32Dll.DecryptMessage( ref context.Handle, ref message.SecBufferDesc, MessageSeqNo, pfQOP); return(Convert(error)); } catch { return(SecurityStatus.SEC_E_UNKNOW_ERROR); } finally { message.Free(); } }
public static unsafe SecurityStatus SafeAcceptSecurityContext( ref SafeCredHandle credential, ref SafeCtxtHandle context, ref SecBufferDescEx input, int contextReq, TargetDataRep targetDataRep, ref SafeCtxtHandle newContext, ref SecBufferDescEx output, out int contextAttr, out long timeStamp) { try { input.Pin(); output.Pin(); fixed(void *fixedContext = &context.Handle) { int error = Secur32Dll.AcceptSecurityContext( ref credential.Handle, (context.IsInvalid) ? null : fixedContext, ref input.SecBufferDesc, contextReq, (int)targetDataRep, ref newContext.Handle, ref output.SecBufferDesc, out contextAttr, out timeStamp); return(Convert(error)); } } catch { contextAttr = 0; timeStamp = 0; return(SecurityStatus.SEC_E_UNKNOW_ERROR); } finally { input.Free(); output.Free(); } }
public static SecurityStatus SafeMakeSignature(SafeCtxtHandle context, ref SecBufferDescEx message, int sequence) { SecurityStatus result; try { message.Pin(); int error = Secur32Dll.MakeSignature(ref context.Handle, 0, ref message.SecBufferDesc, sequence); result = Sspi.Convert(error); } catch { result = (SecurityStatus)4294967295u; } finally { message.Free(); } return(result); }
public static unsafe SecurityStatus SafeAcceptSecurityContext( ref SafeCredHandle credential, ref SafeCtxtHandle context, ref SecBufferDescEx input, int contextReq, TargetDataRep targetDataRep, ref SafeCtxtHandle newContext, ref SecBufferDescEx output) { int contextAttr; long timeStamp; return(SafeAcceptSecurityContext( ref credential, ref context, ref input, contextReq, targetDataRep, ref newContext, ref output, out contextAttr, out timeStamp)); }
public unsafe static SecurityStatus SafeAcceptSecurityContext(ref SafeCredHandle credential, ref SafeCtxtHandle context, ref SecBufferDescEx input, int contextReq, TargetDataRep targetDataRep, ref SafeCtxtHandle newContext, ref SecBufferDescEx output, out int contextAttr, out long timeStamp) { SecurityStatus result; try { input.Pin(); output.Pin(); try { fixed(IntPtr *ptr = (IntPtr *)(&context.Handle)) { int error = Secur32Dll.AcceptSecurityContext(ref credential.Handle, context.IsInvalid ? null : ((void *)ptr), ref input.SecBufferDesc, contextReq, (int)targetDataRep, ref newContext.Handle, ref output.SecBufferDesc, out contextAttr, out timeStamp); result = Sspi.Convert(error); } } finally { IntPtr *ptr = null; } } catch { contextAttr = 0; timeStamp = 0L; result = (SecurityStatus)4294967295u; } finally { input.Free(); output.Free(); } return(result); }
public static SecurityStatus SafeAcceptSecurityContext(ref SafeCredHandle credential, ref SafeCtxtHandle context, ref SecBufferDescEx input, int contextReq, TargetDataRep targetDataRep, ref SafeCtxtHandle newContext, ref SecBufferDescEx output) { int num; long num2; return(Sspi.SafeAcceptSecurityContext(ref credential, ref context, ref input, contextReq, targetDataRep, ref newContext, ref output, out num, out num2)); }
public unsafe static SecurityStatus SafeDecryptMessage(ref SafeCtxtHandle context, ref SecBufferDescEx message, uint MessageSeqNo, void *pfQOP) { SecurityStatus result; try { message.Pin(); int error = Secur32Dll.DecryptMessage(ref context.Handle, ref message.SecBufferDesc, MessageSeqNo, pfQOP); result = Sspi.Convert(error); } catch { result = (SecurityStatus)4294967295u; } finally { message.Free(); } return(result); }