java.lang.Object
waffle.windows.auth.impl.WindowsSecurityContextImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of the context.static booleandispose(com.sun.jna.platform.win32.Sspi.CtxtHandle ctx) Dispose a security context.static IWindowsSecurityContextgetCurrent(String securityPackage, String targetName) Get the current Windows security context for a given SSPI package.com.sun.jna.platform.win32.Sspi.CtxtHandleContext handle.Windows Identity.Principal name.Security package name.byte[]getToken()Token.Impersonate this security context.voidinitialize(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.booleanTrue if protocol requires continuation.voidsetContinue(boolean b) Sets the continue.voidSets the credentials handle.voidsetPrincipalName(String value) Sets the principal name.voidsetSecurityContext(com.sun.jna.platform.win32.Sspi.CtxtHandle phNewServerContext) Sets the security context.voidsetSecurityPackage(String value) Sets the security package.voidsetToken(byte[] bytes) Sets the token.
-
Constructor Details
-
WindowsSecurityContextImpl
public WindowsSecurityContextImpl()
-
-
Method Details
-
impersonate
Description copied from interface:IWindowsSecurityContextImpersonate this security context.- Specified by:
impersonatein interfaceIWindowsSecurityContext- Returns:
- A Windows Impersonation Context.
-
getIdentity
Description copied from interface:IWindowsSecurityContextWindows Identity.- Specified by:
getIdentityin interfaceIWindowsSecurityContext- Returns:
- Windows Identity.
-
getSecurityPackage
Description copied from interface:IWindowsSecurityContextSecurity package name.- Specified by:
getSecurityPackagein interfaceIWindowsSecurityContext- Returns:
- String.
-
getToken
public byte[] getToken()Description copied from interface:IWindowsSecurityContextToken.- Specified by:
getTokenin interfaceIWindowsSecurityContext- Returns:
- Array of bytes.
-
getCurrent
Get the current Windows security context for a given SSPI package.- Parameters:
securityPackage- SSPI package.targetName- The target of the context. The string contents are security-package specific.- Returns:
- Windows security context.
-
initialize
public void initialize(com.sun.jna.platform.win32.Sspi.CtxtHandle continueCtx, com.sun.jna.platform.win32.Sspi.SecBufferDesc continueToken, String targetName) Description copied from interface:IWindowsSecurityContextInitialize the security context, continuing from a previous one.- Specified by:
initializein interfaceIWindowsSecurityContext- Parameters:
continueCtx- Continue context.continueToken- Continue token.targetName- The target of the context. The string contents are security-package specific.
-
dispose
public void dispose()Description copied from interface:IWindowsSecurityContextDisposes of the context.- Specified by:
disposein interfaceIWindowsSecurityContext
-
dispose
public static boolean dispose(com.sun.jna.platform.win32.Sspi.CtxtHandle ctx) Dispose a security context.- Parameters:
ctx- Security context.- Returns:
- True if a context was disposed.
-
getPrincipalName
Description copied from interface:IWindowsSecurityContextPrincipal name.- Specified by:
getPrincipalNamein interfaceIWindowsSecurityContext- Returns:
- String.
-
setPrincipalName
Sets the principal name.- Parameters:
value- the new principal name
-
getHandle
public com.sun.jna.platform.win32.Sspi.CtxtHandle getHandle()Description copied from interface:IWindowsSecurityContextContext handle.- Specified by:
getHandlein interfaceIWindowsSecurityContext- Returns:
- Handle.
-
setCredentialsHandle
Sets the credentials handle.- Parameters:
handle- the new credentials handle
-
setToken
public void setToken(byte[] bytes) Sets the token.- Parameters:
bytes- the new token
-
setSecurityPackage
Sets the security package.- Parameters:
value- the new security package
-
setSecurityContext
public void setSecurityContext(com.sun.jna.platform.win32.Sspi.CtxtHandle phNewServerContext) Sets the security context.- Parameters:
phNewServerContext- the new security context
-
isContinue
public boolean isContinue()Description copied from interface:IWindowsSecurityContextTrue if protocol requires continuation.- Specified by:
isContinuein interfaceIWindowsSecurityContext- Returns:
- True or false.
-
setContinue
public void setContinue(boolean b) Sets the continue.- Parameters:
b- the new continue
-