aicas logoJamaica 3.2 release 62

javax.security.auth.kerberos
Class KerberosPrincipal

java.lang.Object
  extended by javax.security.auth.kerberos.KerberosPrincipal
All Implemented Interfaces:
Serializable, Principal

public final class KerberosPrincipal
extends Object
implements Serializable, Principal

This represents a Kerberos principal. See the Kerberos authentication RFC for more information: RFC 1510.

Since:
1.4
See Also:
Serialized Form

Field Summary
static int KRB_NT_PRINCIPAL
          Constant from the RFC: "Just the name of the principal as in DCE, or for users".
static int KRB_NT_SRV_HST
          Constant from the RFC: "Service and other unique instance (krbtgt)".
static int KRB_NT_SRV_INST
          Constant from the RFC: "Service with host name as instance (telnet, rcommands)".
static int KRB_NT_SRV_XHST
          Constant from the RFC: "Service with host as remaining components".
static int KRB_NT_UID
          Constant from the RFC: "Unique ID".
static int KRB_NT_UNKNOWN
          Constant from the RFC: "Name type not known".
 
Constructor Summary
KerberosPrincipal(String name)
          Create a new instance with the given name and a type of KRB_NT_PRINCIPAL.
KerberosPrincipal(String name, int type)
          Create a new instance with the given name and type.
 
Method Summary
 boolean equals(Object other)
          equals compares this object to another object.
 String getName()
          Return the name of this principal.
 int getNameType()
          Return the type of this principal.
 String getRealm()
          Return the realm of this principal.
 int hashCode()
          hashCode returns a hash code for this object.
 String toString()
          toString creates a printable string that represents this object for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KRB_NT_PRINCIPAL

public static final int KRB_NT_PRINCIPAL
Constant from the RFC: "Just the name of the principal as in DCE, or for users".

See Also:
Constant Field Values

KRB_NT_SRV_HST

public static final int KRB_NT_SRV_HST
Constant from the RFC: "Service and other unique instance (krbtgt)".

See Also:
Constant Field Values

KRB_NT_SRV_INST

public static final int KRB_NT_SRV_INST
Constant from the RFC: "Service with host name as instance (telnet, rcommands)".

See Also:
Constant Field Values

KRB_NT_SRV_XHST

public static final int KRB_NT_SRV_XHST
Constant from the RFC: "Service with host as remaining components".

See Also:
Constant Field Values

KRB_NT_UID

public static final int KRB_NT_UID
Constant from the RFC: "Unique ID".

See Also:
Constant Field Values

KRB_NT_UNKNOWN

public static final int KRB_NT_UNKNOWN
Constant from the RFC: "Name type not known".

See Also:
Constant Field Values
Constructor Detail

KerberosPrincipal

public KerberosPrincipal(String name)
Create a new instance with the given name and a type of KRB_NT_PRINCIPAL.

Parameters:
name - the principal's name

KerberosPrincipal

public KerberosPrincipal(String name,
                         int type)
                  throws gnu.classpath.NotImplementedException
Create a new instance with the given name and type. The name is parsed according to the rules in the RFC. If there is no realm, then the local realm is used instead.

Parameters:
name - the principal's name
type - the principal's type
Throws:
gnu.classpath.NotImplementedException
Method Detail

getName

public String getName()
Return the name of this principal.

Specified by:
getName in interface Principal
Returns:
the name of this Principal

getRealm

public String getRealm()
Return the realm of this principal.


getNameType

public int getNameType()
Return the type of this principal.


hashCode

public int hashCode()
Description copied from class: Object
hashCode returns a hash code for this object. The hash code must be equal for two objects a and b if a.equals(b) is true.

The default implementation returns System.identityHashCode(this).

Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
a hash code value.

equals

public boolean equals(Object other)
Description copied from class: Object
equals compares this object to another object.

Equals must be symmetric (a.equals(b) == b.equals(a)), reflexive (a.equals(a)==true) and transitive (a.equals(b) && b.equals(c) IMPLIES (a.equals(c))) and not change over time (a.equals(b) == a.equals(b)). a.equals(null) should always return false.

If a.equals(b) is true for two objects a and b, then a.hashCode()==b.hashCode() must hold.

The default implementation of equals returns this==other.

Specified by:
equals in interface Principal
Overrides:
equals in class Object
Parameters:
other - the other object.
Returns:
if this and other are considered equal.

toString

public String toString()
Description copied from class: Object
toString creates a printable string that represents this object for debugging purposes.

The default implementation returns getClass().getName() + '@' + Integer.toHexString(hashCode()).

Specified by:
toString in interface Principal
Overrides:
toString in class Object
Returns:
a string identifying this object.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.