Package org.apache.wss4j.common.kerberos
Class KerberosContext
- java.lang.Object
-
- org.apache.wss4j.common.kerberos.KerberosContext
-
public class KerberosContext extends Object
Encapsulates Kerberos token (service ticket) and secret key returned byKerberosClientExceptionAction
. The secret key might be null, in which case it must be obtained from the current subject'sKerberosTicket
private credential.- Author:
- bgde
-
-
Constructor Summary
Constructors Constructor Description KerberosContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Destroys all data held in this context instance.GSSContext
getGssContext()
byte[]
getKerberosToken()
Key
getSecretKey()
boolean
isDisposed()
Checks if this context instance is already destroyed.void
setGssContext(GSSContext gssContext)
void
setKerberosToken(byte[] kerberosToken)
void
setSecretKey(Key secretKey)
-
-
-
Method Detail
-
getKerberosToken
public byte[] getKerberosToken()
- Returns:
- The Kerberos service ticket bytes or null they are not available/set.
- Throws:
IllegalStateException
- If this context was already disposed.
-
setKerberosToken
public void setKerberosToken(byte[] kerberosToken)
-
getSecretKey
public Key getSecretKey()
- Returns:
- The secret session key, or null if it is not available.
In this case it must be obtained from the current subject's
KerberosTicket
private credential. - Throws:
IllegalStateException
- If this context was already disposed.
-
setSecretKey
public void setSecretKey(Key secretKey)
-
getGssContext
public GSSContext getGssContext()
- Returns:
- The GSSContext as initialized during Kerberos service ticket retrieval.
- Throws:
IllegalStateException
- If this context was already disposed.
-
setGssContext
public void setGssContext(GSSContext gssContext)
-
dispose
public void dispose()
Destroys all data held in this context instance. After calling this method, an attempt to retrieve any field of this context instance will throw an IllegalArgumentException.
-
isDisposed
public boolean isDisposed()
Checks if this context instance is already destroyed.
-
-