org.apache.ws.security.message.token
Class KerberosSecurity

java.lang.Object
  extended by org.apache.ws.security.message.token.BinarySecurity
      extended by org.apache.ws.security.message.token.KerberosSecurity

public class KerberosSecurity
extends BinarySecurity

Kerberos Security Token.


Field Summary
 
Fields inherited from class org.apache.ws.security.message.token.BinarySecurity
BASE64_ENCODING, element, TOKEN_BST, TOKEN_KI
 
Constructor Summary
KerberosSecurity(Document doc)
          This constructor creates a new Kerberos element.
KerberosSecurity(Element elem)
          This constructor creates a new Kerberos token object and initializes it from the data contained in the element.
KerberosSecurity(Element elem, boolean bspCompliant)
          This constructor creates a new Kerberos token object and initializes it from the data contained in the element.
 
Method Summary
 SecretKey getSecretKey()
          Get the SecretKey associated with the service principal
 boolean isGssV5ApReq()
          Return true if this token is a Kerberos GSS V5 AP REQ token
static boolean isKerberosToken(String valueType)
          Return true if the valueType represents a Kerberos Token
 boolean isV5ApReq()
          Return true if this token is a Kerberos V5 AP REQ token
 void retrieveServiceTicket(String jaasLoginModuleName, CallbackHandler callbackHandler, String serviceName)
          Retrieve a service ticket from a KDC using the Kerberos JAAS module, and set it in this BinarySecurityToken.
 
Methods inherited from class org.apache.ws.security.message.token.BinarySecurity
addWSSENamespace, addWSUNamespace, equals, getElement, getEncodingType, getFirstNode, getID, getToken, getValueType, hashCode, setEncodingType, setID, setToken, setValueType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KerberosSecurity

public KerberosSecurity(Element elem)
                 throws WSSecurityException
This constructor creates a new Kerberos token object and initializes it from the data contained in the element.

Parameters:
elem - the element containing the Kerberos token data
Throws:
WSSecurityException

KerberosSecurity

public KerberosSecurity(Element elem,
                        boolean bspCompliant)
                 throws WSSecurityException
This constructor creates a new Kerberos token object and initializes it from the data contained in the element.

Parameters:
elem - the element containing the Kerberos token data
bspCompliant - Whether the token is processed according to the BSP spec
Throws:
WSSecurityException

KerberosSecurity

public KerberosSecurity(Document doc)
This constructor creates a new Kerberos element.

Parameters:
doc -
Method Detail

isV5ApReq

public boolean isV5ApReq()
Return true if this token is a Kerberos V5 AP REQ token


isGssV5ApReq

public boolean isGssV5ApReq()
Return true if this token is a Kerberos GSS V5 AP REQ token


retrieveServiceTicket

public void retrieveServiceTicket(String jaasLoginModuleName,
                                  CallbackHandler callbackHandler,
                                  String serviceName)
                           throws WSSecurityException
Retrieve a service ticket from a KDC using the Kerberos JAAS module, and set it in this BinarySecurityToken.

Parameters:
jaasLoginModuleName - the JAAS Login Module name to use
callbackHandler - a CallbackHandler instance to retrieve a password (optional)
serviceName - the desired Kerberized service
Throws:
WSSecurityException

getSecretKey

public SecretKey getSecretKey()
Get the SecretKey associated with the service principal

Returns:
the SecretKey associated with the service principal

isKerberosToken

public static boolean isKerberosToken(String valueType)
Return true if the valueType represents a Kerberos Token

Parameters:
valueType - the valueType of the token
Returns:
true if the valueType represents a Kerberos Token


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.