Package waffle.mock
Class MockWindowsSecurityContext
java.lang.Object
waffle.mock.MockWindowsSecurityContext
- All Implemented Interfaces:
IWindowsSecurityContext
The Class MockWindowsSecurityContext.
-
Constructor Summary
ConstructorDescriptionMockWindowsSecurityContext
(String username) Instantiates a new mock windows security context. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the context.com.sun.jna.platform.win32.Sspi.CtxtHandle
Context handle.Windows Identity.Principal name.Security package name.byte[]
getToken()
Token.Impersonate this security context.void
Initialize.void
initialize
(com.sun.jna.platform.win32.Sspi.CtxtHandle continueCtx, com.sun.jna.platform.win32.Sspi.SecBufferDesc continueToken, String targetPrincipalName) Initialize the security context, continuing from a previous one.boolean
True if protocol requires continuation.
-
Constructor Details
-
MockWindowsSecurityContext
Instantiates a new mock windows security context.- Parameters:
username
- the username
-
-
Method Details
-
dispose
public void dispose()Description copied from interface:IWindowsSecurityContext
Disposes of the context.- Specified by:
dispose
in interfaceIWindowsSecurityContext
-
isContinue
public boolean isContinue()Description copied from interface:IWindowsSecurityContext
True if protocol requires continuation.- Specified by:
isContinue
in interfaceIWindowsSecurityContext
- Returns:
- True or false.
-
getHandle
public com.sun.jna.platform.win32.Sspi.CtxtHandle getHandle()Description copied from interface:IWindowsSecurityContext
Context handle.- Specified by:
getHandle
in interfaceIWindowsSecurityContext
- Returns:
- Handle.
-
getIdentity
Description copied from interface:IWindowsSecurityContext
Windows Identity.- Specified by:
getIdentity
in interfaceIWindowsSecurityContext
- Returns:
- Windows Identity.
-
getPrincipalName
Description copied from interface:IWindowsSecurityContext
Principal name.- Specified by:
getPrincipalName
in interfaceIWindowsSecurityContext
- Returns:
- String.
-
getSecurityPackage
Description copied from interface:IWindowsSecurityContext
Security package name.- Specified by:
getSecurityPackage
in interfaceIWindowsSecurityContext
- Returns:
- String.
-
getToken
public byte[] getToken()Description copied from interface:IWindowsSecurityContext
Token.- Specified by:
getToken
in interfaceIWindowsSecurityContext
- Returns:
- Array of bytes.
-
impersonate
Description copied from interface:IWindowsSecurityContext
Impersonate this security context.- Specified by:
impersonate
in interfaceIWindowsSecurityContext
- Returns:
- A Windows Impersonation Context.
-
initialize
public void initialize()Initialize. -
initialize
public void initialize(com.sun.jna.platform.win32.Sspi.CtxtHandle continueCtx, com.sun.jna.platform.win32.Sspi.SecBufferDesc continueToken, String targetPrincipalName) Description copied from interface:IWindowsSecurityContext
Initialize the security context, continuing from a previous one.- Specified by:
initialize
in interfaceIWindowsSecurityContext
- Parameters:
continueCtx
- Continue context.continueToken
- Continue token.targetPrincipalName
- The target of the context. The string contents are security-package specific.
-