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(com.sun.jna.platform.win32.Sspi.CredHandle 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()
IWindowsSecurityContext
impersonate
in interface IWindowsSecurityContext
public IWindowsIdentity getIdentity()
IWindowsSecurityContext
getIdentity
in interface IWindowsSecurityContext
public String getSecurityPackage()
IWindowsSecurityContext
getSecurityPackage
in interface IWindowsSecurityContext
public byte[] getToken()
IWindowsSecurityContext
getToken
in interface IWindowsSecurityContext
public 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)
IWindowsSecurityContext
initialize
in interface IWindowsSecurityContext
continueCtx
- Continue context.continueToken
- Continue token.targetName
- The target of the context. The string contents are security-package specific.public void dispose()
IWindowsSecurityContext
dispose
in interface IWindowsSecurityContext
public static boolean dispose(com.sun.jna.platform.win32.Sspi.CtxtHandle ctx)
ctx
- Security context.public String getPrincipalName()
IWindowsSecurityContext
getPrincipalName
in interface IWindowsSecurityContext
public void setPrincipalName(String value)
value
- the new principal namepublic com.sun.jna.platform.win32.Sspi.CtxtHandle getHandle()
IWindowsSecurityContext
getHandle
in interface IWindowsSecurityContext
public void setCredentialsHandle(com.sun.jna.platform.win32.Sspi.CredHandle 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()
IWindowsSecurityContext
isContinue
in interface IWindowsSecurityContext
public void setContinue(boolean b)
b
- the new continueCopyright © 2010–2015 com.github.dblock. All rights reserved.