public class WindowsSecurityContextImpl extends Object implements IWindowsSecurityContext
| Constructor and Description |
|---|
WindowsSecurityContextImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes of the context.
|
static boolean |
dispose(com.sun.jna.platform.win32.Sspi.CtxtHandle ctx)
Dispose a security context.
|
static IWindowsSecurityContext |
getCurrent(String securityPackage,
String targetName)
Get the current Windows security context for a given SSPI package.
|
com.sun.jna.platform.win32.Sspi.CtxtHandle |
getHandle()
Context handle.
|
IWindowsIdentity |
getIdentity()
Windows Identity.
|
String |
getPrincipalName()
Principal name.
|
String |
getSecurityPackage()
Security package name.
|
byte[] |
getToken()
Token.
|
IWindowsImpersonationContext |
impersonate()
Impersonate this security context.
|
void |
initialize(com.sun.jna.platform.win32.Sspi.CtxtHandle continueCtx,
com.sun.jna.platform.win32.Sspi.SecBufferDesc continueToken,
String targetName)
Initialize the security context, continuing from a previous one.
|
boolean |
isContinue()
True if protocol requires continuation.
|
void |
setContinue(boolean b)
Sets the continue.
|
void |
setCredentialsHandle(IWindowsCredentialsHandle handle)
Sets the credentials handle.
|
void |
setPrincipalName(String value)
Sets the principal name.
|
void |
setSecurityContext(com.sun.jna.platform.win32.Sspi.CtxtHandle phNewServerContext)
Sets the security context.
|
void |
setSecurityPackage(String value)
Sets the security package.
|
void |
setToken(byte[] bytes)
Sets the token.
|
public IWindowsImpersonationContext impersonate()
IWindowsSecurityContextimpersonate in interface IWindowsSecurityContextpublic IWindowsIdentity getIdentity()
IWindowsSecurityContextgetIdentity in interface IWindowsSecurityContextpublic String getSecurityPackage()
IWindowsSecurityContextgetSecurityPackage in interface IWindowsSecurityContextpublic byte[] getToken()
IWindowsSecurityContextgetToken in interface IWindowsSecurityContextpublic static IWindowsSecurityContext getCurrent(String securityPackage, String targetName)
securityPackage - SSPI package.targetName - The target of the context. The string contents are security-package specific.public void initialize(com.sun.jna.platform.win32.Sspi.CtxtHandle continueCtx,
com.sun.jna.platform.win32.Sspi.SecBufferDesc continueToken,
String targetName)
IWindowsSecurityContextinitialize in interface IWindowsSecurityContextcontinueCtx - Continue context.continueToken - Continue token.targetName - The target of the context. The string contents are security-package specific.public void dispose()
IWindowsSecurityContextdispose in interface IWindowsSecurityContextpublic static boolean dispose(com.sun.jna.platform.win32.Sspi.CtxtHandle ctx)
ctx - Security context.public String getPrincipalName()
IWindowsSecurityContextgetPrincipalName in interface IWindowsSecurityContextpublic void setPrincipalName(String value)
value - the new principal namepublic com.sun.jna.platform.win32.Sspi.CtxtHandle getHandle()
IWindowsSecurityContextgetHandle in interface IWindowsSecurityContextpublic void setCredentialsHandle(IWindowsCredentialsHandle handle)
handle - the new credentials handlepublic void setToken(byte[] bytes)
bytes - the new tokenpublic void setSecurityPackage(String value)
value - the new security packagepublic void setSecurityContext(com.sun.jna.platform.win32.Sspi.CtxtHandle phNewServerContext)
phNewServerContext - the new security contextpublic boolean isContinue()
IWindowsSecurityContextisContinue in interface IWindowsSecurityContextpublic void setContinue(boolean b)
b - the new continueCopyright © 2010–2015 com.github.dblock. All rights reserved.