Class KerberosContext


  • public class KerberosContext
    extends Object
    Encapsulates Kerberos token (service ticket) and secret key returned by KerberosClientExceptionAction. The secret key might be null, in which case it must be obtained from the current subject's KerberosTicket private credential.
    Author:
    bgde
    • Constructor Detail

      • KerberosContext

        public KerberosContext()
    • 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.