javax.security.auth.kerberos

Class KerberosPrincipal

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

Field Summary
static intKRB_NT_PRINCIPAL
Constant from the RFC: "Just the name of the principal as in DCE, or for users".
static intKRB_NT_SRV_HST
Constant from the RFC: "Service and other unique instance (krbtgt)".
static intKRB_NT_SRV_INST
Constant from the RFC: "Service with host name as instance (telnet, rcommands)".
static intKRB_NT_SRV_XHST
Constant from the RFC: "Service with host as remaining components".
static intKRB_NT_UID
Constant from the RFC: "Unique ID".
static intKRB_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 {@link #KRB_NT_PRINCIPAL}.
KerberosPrincipal(String name, int type)
Create a new instance with the given name and type.
Method Summary
booleanequals(Object other)
StringgetName()
Return the name of this principal.
intgetNameType()
Return the type of this principal.
StringgetRealm()
Return the realm of this principal.
inthashCode()
StringtoString()

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".

KRB_NT_SRV_HST

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

KRB_NT_SRV_INST

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

KRB_NT_SRV_XHST

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

KRB_NT_UID

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

KRB_NT_UNKNOWN

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

Constructor Detail

KerberosPrincipal

public KerberosPrincipal(String name)
Create a new instance with the given name and a type of {@link #KRB_NT_PRINCIPAL}.

Parameters: name the principal's name

KerberosPrincipal

public KerberosPrincipal(String name, int type)
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

Method Detail

equals

public boolean equals(Object other)

getName

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

getNameType

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

getRealm

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

hashCode

public int hashCode()

toString

public String toString()