所有类


javax.security.auth.kerberos
类 KerberosPrincipal

java.lang.Object
  继承者 javax.security.auth.kerberos.KerberosPrincipal
所有已实现的接口:
Serializable, Principal

public final class KerberosPrincipal
   
   
   
   
   
extends Object
implements Principal, Serializable

此类封装 Kerberos 主体。

从以下版本开始:
1.4
另请参见:
序列化表格

字段摘要
static intKRB_NT_PRINCIPAL
          用户主体名称类型。
static intKRB_NT_SRV_HST
          主机名作为实例 (telnet, rcommands) 的服务的名称类型。
static intKRB_NT_SRV_INST
          服务和其他唯一实例 (krbtgt) 名称类型。
static intKRB_NT_SRV_XHST
          将主机名作为剩余组件的服务的名称类型。
static intKRB_NT_UID
          唯一 ID 名称类型。
static intKRB_NT_UNKNOWN
          未知的名称类型。
 
构造方法摘要
KerberosPrincipal(String name)
          根据提供的字符串输入构造 KerberosPrincipal。
KerberosPrincipal(String name, int nameType)
          根据提供的字符串和名称类型输入构造 KerberosPrincipal。
 
方法摘要
 booleanequals(Object other)
          比较指定的对象与此 Principal 是否相等。
 StringgetName()
          返回的字符串对应于 Kerberos Principal 名称的 single-string 表示形式,RFC 1964 的 2.1 小节中指定了这种表示形式。
 intgetNameType()
          返回 KerberosPrincipal 的名称类型。
 StringgetRealm()
          返回此 Kerberos 主体的域组件。
 inthashCode()
          返回此主体的哈希码。
 StringtoString()
          返回该对象的字符串表示。
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

字段详细信息

KRB_NT_UNKNOWN

public static final int KRB_NT_UNKNOWN
未知的名称类型。

另请参见:
常量字段值

KRB_NT_PRINCIPAL

public static final int KRB_NT_PRINCIPAL
用户主体名称类型。

另请参见:
常量字段值

KRB_NT_SRV_INST

public static final int KRB_NT_SRV_INST
服务和其他唯一实例 (krbtgt) 名称类型。

另请参见:
常量字段值

KRB_NT_SRV_HST

public static final int KRB_NT_SRV_HST
主机名作为实例 (telnet, rcommands) 的服务的名称类型。

另请参见:
常量字段值

KRB_NT_SRV_XHST

public static final int KRB_NT_SRV_XHST
将主机名作为剩余组件的服务的名称类型。

另请参见:
常量字段值

KRB_NT_UID

public static final int KRB_NT_UID
唯一 ID 名称类型。

另请参见:
常量字段值
构造方法详细信息

KerberosPrincipal

public KerberosPrincipal(String name)
根据提供的字符串输入构造 KerberosPrincipal。此主体的名称类型默认为 KRB_NT_PRINCIPAL 假定此字符串包含一个名称,该名称的格式在 RFC 1964 的 2.1.1. 小节 (Kerberos Principal Name Form) 中指定(例如 duke@FOO.COM,其中的 duke 表示主体,FOO.COM 表示域)。

如果输入的名称中不包含域,则使用默认的域。默认域可以在 Kerberos 配置文件中指定或通过 java.security.krb5.realm 系统属性指定。有关的更多信息请参见 Kerberos Requirements

参数:
name - 主体名称
抛出:
IllegalArgumentException - 如果名称不是正确格式的,或者如果名称为 null,抑或如果名称不包含将使用的域,并且没有在 Kerberos 配置文件或 java.security.krb5.realm 系统属性中指定默认域。

KerberosPrincipal

public KerberosPrincipal(String name,
                         int nameType)
根据提供的字符串和名称类型输入构造 KerberosPrincipal。假定此字符串包含一个名称,RFC 1964 的 2.1 小节 (Mandatory Name Forms) 中指定了该字符串的格式。RFC 1510 的 7.2 小节 (Principal Names) 中指定了有效的名称类型。输入的名称必须与提供的名称类型一致。(例如,duke@FOO.COM 是 KRB_NT_PRINCIPAL 名称类型的有效输入字符串,其中 duke 表示主体,FOO.COM 表示域)。

如果输入的名称中不包含域,则使用默认的域。可以在 Kerberos 配置文件中指定默认域或通过 java.security.krb5.realm 系统属性指定默认域。有关的更多信息请参见 Kerberos Requirements

参数:
name - 主体名称
nameType - 主体的名称类型
抛出:
IllegalArgumentException - 如果名称不是正确格式的,或者名称为 null,抑或如果 nameType 不受支持,或者如果名称不包含将使用的域并且没有在 Kerberos 配置文件中指定默认域或通过 java.security.krb5.realm 系统属性指定默认域。
方法详细信息

getRealm

public String getRealm()
返回此 Kerberos 主体的域组件。

返回:
此 Kerberos 主体的域组件。