• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SecHandle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SecHandle的典型用法代码示例。如果您正苦于以下问题:C# SecHandle类的具体用法?C# SecHandle怎么用?C# SecHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SecHandle类属于命名空间,在下文中一共展示了SecHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AcquireCredentialsHandle

 private extern static int AcquireCredentialsHandle(
     string pszPrincipal,
     string pszPackage,
     int fCredentialUse,
     IntPtr pvLogonID,
     IntPtr pAuthData,
     IntPtr pGetKeyFn,
     IntPtr pvGetKeyArgument,
     ref SecHandle phCredential,
     out SecHandle ptsExpiry
 );
开发者ID:seeseekey,项目名称:CSCL,代码行数:11,代码来源:SSPIHandler.cs


示例2: InitializeSecurityContext

 static extern int InitializeSecurityContext(
     ref SecHandle phCredential,
     IntPtr phContext,
     string pszTargetName,
     int fContextReq,
     int Reserved1,
     int TargetDataRep,
     IntPtr pInput,
     int Reserved2,
     out SecHandle phNewContext,
     out SecBufferDesc pOutput,
     out int pfContextAttr,
     out SecHandle ptsExpiry);
开发者ID:seeseekey,项目名称:CSCL,代码行数:13,代码来源:SSPIHandler.cs


示例3: ImpersonateSecurityContext__

 private static extern int ImpersonateSecurityContext__(SecHandle phContext);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:1,代码来源:SspiApi.cs


示例4: FreeCredentialsHandle

 public static extern int FreeCredentialsHandle(ref SecHandle phCredential);
开发者ID:MagnusVortex,项目名称:OCTGN,代码行数:1,代码来源:Interop.cs


示例5: AcquireCredentialsHandle

 public static extern int AcquireCredentialsHandle(string pszPrincipal, string pszPackage, uint fCredentialUse,
     IntPtr pvLogonID, IntPtr pAuthData, IntPtr pGetKeyFn,
     IntPtr pvGetKeyArgument, ref SecHandle phCredential,
     ref long ptsExpiry);
开发者ID:MagnusVortex,项目名称:OCTGN,代码行数:4,代码来源:Interop.cs


示例6: CloseClientCredentials

		private void CloseClientCredentials()
		{
			if (!_clientCredentials.IsInvalid)
			{
				FreeCredentialsHandle(ref _clientCredentials);
				_clientCredentials = new SecHandle();
			}
		}
开发者ID:fishcodelib,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:8,代码来源:SSPIHelper.cs


示例7: DeleteSecurityContext

		static extern int DeleteSecurityContext(ref SecHandle phContext); //PCtxtHandle
开发者ID:fishcodelib,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:1,代码来源:SSPIHelper.cs


示例8: InitializeSecurityContext

		static extern int InitializeSecurityContext(
			ref SecHandle phCredential,//PCredHandle
			ref SecHandle phContext, //PCtxtHandle
			string pszTargetName,
			int fContextReq,
			int Reserved1,
			int TargetDataRep,
			ref SecBufferDesc SecBufferDesc, //PSecBufferDesc SecBufferDesc
			int Reserved2,
			out SecHandle phNewContext, //PCtxtHandle
			ref SecBufferDesc pOutput, //PSecBufferDesc SecBufferDesc
			out uint pfContextAttr, //managed ulong == 64 bits!!!
			out SecInteger ptsExpiry //PTimeStamp
		);
开发者ID:fishcodelib,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:14,代码来源:SSPIHelper.cs


示例9: FreeCredentialsHandle

 private static extern int FreeCredentialsHandle(
     ref SecHandle phCredential
 );
开发者ID:NoeGarcia,项目名称:Npgsql,代码行数:3,代码来源:SSPIHandler.cs


示例10: DeleteSecurityContext

        /// <summary>
        /// Calls DeleteSecurityContext SSPI API function.
        /// Ignores all possible returned errors.
        /// </summary>
        /// <param name="phContext">Security context being deleted.</param>
        public static void DeleteSecurityContext(SecHandle phContext)
        {
            if (_isNT)
                DeleteSecurityContext_NT(phContext);
            else
                DeleteSecurityContext__(phContext);

            phContext.dwLower = 0;
            phContext.dwUpper = 0;
        }
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:15,代码来源:SspiApi.cs


示例11: VerifySignature__

 private static extern int VerifySignature__(SecHandle phContext,
     ref SecBufferDescNative pMessage, int MessageSeqNo,
     ref int pfQOP);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:3,代码来源:SspiApi.cs


示例12: RevertSecurityContext__

 private static extern int RevertSecurityContext__(SecHandle phContext);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:1,代码来源:SspiApi.cs


示例13: QuerySecurityContextToken__

 private static extern int QuerySecurityContextToken__(SecHandle phContext, out IntPtr phToken);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:1,代码来源:SspiApi.cs


示例14: QueryContextAttributes__

 private static extern int QueryContextAttributes__(SecHandle phContext,
     int ulAttribute, ref SecPkgContext_Sizes pBuffer);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:2,代码来源:SspiApi.cs


示例15: MakeSignature__

 private static extern int MakeSignature__(SecHandle phContext, int fQOP, 
     ref SecBufferDescNative pMessage, int MessageSeqNo);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:2,代码来源:SspiApi.cs


示例16: InitializeSecurityContext__

 private static extern int InitializeSecurityContext__(SecHandle phCredential,
     SecHandle phContext, string pszTargetName, int fContextReq, int Reserved1,
     int TargetDataRep, ref SecBufferDescNative pInput, int Reserved2, SecHandle phNewContext,
     ref SecBufferDescNative pOutput, ref int pfContextAttr, ref Int64 ptsExpiry);
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:4,代码来源:SspiApi.cs


示例17: DeleteSecurityContext

 private static extern int DeleteSecurityContext(
     ref SecHandle phContext
 );
开发者ID:NoeGarcia,项目名称:Npgsql,代码行数:3,代码来源:SSPIHandler.cs


示例18: FreeCredentialsHandle

        /// <summary>
        /// Calls FreeCredentialsHandle SSPI API function.
        /// Ignores all possible returned errors.
        /// </summary>
        /// <param name="credHandle">Credential handle being freed.</param>
        public static void FreeCredentialsHandle(SecHandle credHandle)
        {
            if (_isNT)
                FreeCredentialsHandle_NT(credHandle);
            else
                FreeCredentialsHandle__(credHandle);

            credHandle.dwLower = 0;
            credHandle.dwUpper = 0;
        }
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:15,代码来源:SspiApi.cs


示例19: AcquireCredentialsHandle

		static extern int AcquireCredentialsHandle(
			string pszPrincipal, //SEC_CHAR*
			string pszPackage, //SEC_CHAR* //"Kerberos","NTLM","Negotiative"
			int fCredentialUse,
			IntPtr PAuthenticationID,//_LUID AuthenticationID,//pvLogonID, //PLUID
			IntPtr pAuthData,//PVOID
			int pGetKeyFn, //SEC_GET_KEY_FN
			IntPtr pvGetKeyArgument, //PVOID
			out SecHandle phCredential, //SecHandle //PCtxtHandle ref
			out SecInteger ptsExpiry //PTimeStamp //TimeStamp ref
		);
开发者ID:fishcodelib,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:11,代码来源:SSPIHelper.cs


示例20: CloneSecurityToken

        /// <summary>
        /// Duplicates a security token for another process.
        /// </summary>
        /// <param name="phContext">Security context handle.</param>
        /// <param name="remoteProcessId">The identifier of the remote process.</param>
        /// <returns>The handle of security token for another process.</returns>
        public static IntPtr CloneSecurityToken(SecHandle phContext, int remoteProcessId)
        {
            int result = 0;

            // get the security token
            IntPtr phToken = IntPtr.Zero;
            if (_isNT)
                result = QuerySecurityContextToken_NT(phContext, out phToken);
            else
                result = QuerySecurityContextToken__(phContext, out phToken);

            if (result != SspiApi.SEC_E_OK)
                throw GenuineExceptions.Get_Windows_SspiError(result);

            try
            {
                return CloneSecurityToken(phToken, remoteProcessId);
            }
            finally
            {
                // close security token
                CloseHandle(phToken);
            }
        }
开发者ID:ArsenShnurkov,项目名称:GenuineChannels,代码行数:30,代码来源:SspiApi.cs



注:本文中的SecHandle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Section类代码示例发布时间:2022-05-24
下一篇:
C# Season类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap