gpt4 book ai didi

waffle.windows.auth.impl.WindowsSecurityContextImpl.setCredentialsHandle()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 05:57:05 27 4
gpt4 key购买 nike

本文整理了Java中waffle.windows.auth.impl.WindowsSecurityContextImpl.setCredentialsHandle()方法的一些代码示例,展示了WindowsSecurityContextImpl.setCredentialsHandle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsSecurityContextImpl.setCredentialsHandle()方法的具体详情如下:
包路径:waffle.windows.auth.impl.WindowsSecurityContextImpl
类名称:WindowsSecurityContextImpl
方法名:setCredentialsHandle

WindowsSecurityContextImpl.setCredentialsHandle介绍

[英]Sets the credentials handle.
[中]设置凭据句柄。

代码示例

代码示例来源:origin: org.postgresql/postgresql

sspiContext.setCredentialsHandle(clientCredentials);
sspiContext.setSecurityPackage(securityPackage);
sspiContext.initialize(null, null, targetName);

代码示例来源:origin: stackoverflow.com

clientContext.setCredentialsHandle(credentials.getHandle());
clientContext.setSecurityPackage(securityPackage);
clientContext.initialize();

代码示例来源:origin: com.github.dblock.waffle/waffle-jna

sc.setCredentialsHandle(serverCredential);
sc.setSecurityPackage(securityPackage);
sc.setSecurityContext(phNewServerContext);

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth

clientContext.setCredentialsHandle(clientCredentials.getHandle());
clientContext.setSecurityPackage(securityPackage);
clientContext.initialize(null, null, WindowsAccountImpl.getCurrentUsername());

代码示例来源:origin: com.github.dblock.waffle/waffle-jna

/**
 * Get the current Windows security context for a given SSPI package.
 * 
 * @param securityPackage
 *            SSPI package.
 * @param targetName
 *            The target of the context. The string contents are security-package specific.
 * @return Windows security context.
 */
public static IWindowsSecurityContext getCurrent(final String securityPackage, final String targetName) {
  IWindowsCredentialsHandle credentialsHandle = WindowsCredentialsHandleImpl.getCurrent(securityPackage);
  credentialsHandle.initialize();
  try {
    final WindowsSecurityContextImpl ctx = new WindowsSecurityContextImpl();
    ctx.setPrincipalName(WindowsAccountImpl.getCurrentUsername());
    ctx.setCredentialsHandle(credentialsHandle);
    ctx.setSecurityPackage(securityPackage);
    ctx.initialize(null, null, targetName);
    // Starting from here ctx 'owns' the credentials handle, so let's null out the
    // variable. This will prevent the finally block below from disposing it right away.
    credentialsHandle = null;
    return ctx;
  } finally {
    if (credentialsHandle != null) {
      credentialsHandle.dispose();
    }
  }
}

代码示例来源:origin: Waffle/waffle

/**
 * Get the current Windows security context for a given SSPI package.
 *
 * @param securityPackage
 *            SSPI package.
 * @param targetName
 *            The target of the context. The string contents are security-package specific.
 * @return Windows security context.
 */
public static IWindowsSecurityContext getCurrent(final String securityPackage, final String targetName) {
  IWindowsCredentialsHandle credentialsHandle = WindowsCredentialsHandleImpl.getCurrent(securityPackage);
  credentialsHandle.initialize();
  try {
    final WindowsSecurityContextImpl ctx = new WindowsSecurityContextImpl();
    ctx.setPrincipalName(WindowsAccountImpl.getCurrentUsername());
    ctx.setCredentialsHandle(credentialsHandle);
    ctx.setSecurityPackage(securityPackage);
    ctx.initialize(null, null, targetName);
    // Starting from here ctx 'owns' the credentials handle, so let's null out the
    // variable. This will prevent the finally block below from disposing it right away.
    credentialsHandle = null;
    return ctx;
  } finally {
    if (credentialsHandle != null) {
      credentialsHandle.dispose();
    }
  }
}

代码示例来源:origin: com.github.waffle/waffle-jna

/**
 * Get the current Windows security context for a given SSPI package.
 *
 * @param securityPackage
 *            SSPI package.
 * @param targetName
 *            The target of the context. The string contents are security-package specific.
 * @return Windows security context.
 */
public static IWindowsSecurityContext getCurrent(final String securityPackage, final String targetName) {
  IWindowsCredentialsHandle credentialsHandle = WindowsCredentialsHandleImpl.getCurrent(securityPackage);
  credentialsHandle.initialize();
  try {
    final WindowsSecurityContextImpl ctx = new WindowsSecurityContextImpl();
    ctx.setPrincipalName(WindowsAccountImpl.getCurrentUsername());
    ctx.setCredentialsHandle(credentialsHandle);
    ctx.setSecurityPackage(securityPackage);
    ctx.initialize(null, null, targetName);
    // Starting from here ctx 'owns' the credentials handle, so let's null out the
    // variable. This will prevent the finally block below from disposing it right away.
    credentialsHandle = null;
    return ctx;
  } finally {
    if (credentialsHandle != null) {
      credentialsHandle.dispose();
    }
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth

clientContext.setCredentialsHandle(clientCredentials.getHandle());
clientContext.setSecurityPackage(securityPackage);
clientContext.initialize(null, null, WindowsAccountImpl.getCurrentUsername());

代码示例来源:origin: com.github.waffle/waffle-jna

sc.setCredentialsHandle(serverCredential);
sc.setSecurityPackage(securityPackage);
sc.setSecurityContext(phNewServerContext);

代码示例来源:origin: Waffle/waffle

sc.setCredentialsHandle(serverCredential);
sc.setSecurityPackage(securityPackage);
sc.setSecurityContext(phNewServerContext);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com