public final class KerberosPrincipal extends Object implements Principal, Serializable
Modifier and Type | Field and Description |
---|---|
static int |
KRB_NT_PRINCIPAL
用户主名称类型。
|
static int |
KRB_NT_SRV_HST
主机名称服务实例(telnet,rcommands)名称类型。
|
static int |
KRB_NT_SRV_INST
服务和其他独特的实例(krbtgt)名称类型。
|
static int |
KRB_NT_SRV_XHST
服务与主机作为剩余的组件名称类型。
|
static int |
KRB_NT_UID
唯一的标识类型。
|
static int |
KRB_NT_UNKNOWN
未知名称类型。
|
Constructor and Description |
---|
KerberosPrincipal(String name)
构建了一个kerberosprincipal从提供的字符串的输入。
|
KerberosPrincipal(String name, int nameType)
构建了一个kerberosprincipal从提供的字符串和名称输入。
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
将指定的对象与该主体的相等性进行比较。
|
String |
getName()
返回的字符串对应一个Kerberos主要名称单字符串表示形式,在2.1条规定的
RFC 1964。
|
int |
getNameType()
返回KerberosPrincipal的类型名称。
|
String |
getRealm()
返回该Kerberos主要领域构件。
|
int |
hashCode()
返回该主体的hash码。
|
String |
toString()
返回对象的字符串表示形式。
|
public static final int KRB_NT_UNKNOWN
public static final int KRB_NT_PRINCIPAL
public static final int KRB_NT_SRV_INST
public static final int KRB_NT_SRV_HST
public static final int KRB_NT_SRV_XHST
public static final int KRB_NT_UID
public KerberosPrincipal(String name)
KRB_NT_PRINCIPAL
这个字符串被认为是在2.1.1节所指定的格式包含一个名称名称类型。(Kerberos主要名称的形式)的
RFC 1964 (例如,duke@foo.com,哪里公爵代表校长和foo.com代表境界)。
如果输入的名称不包含一个域,则使用默认的域。默认的域可以指定一个Kerberos配置文件或通过java.security.krb5.realm系统性能。有关更多信息, Kerberos Requirements
name
-主的名字
IllegalArgumentException
如果名称是不正确的格式,如果名称为空,或者名称不包含领域使用默认的境界是不在任何一个Kerberos配置文件或通过java.security.krb5.realm系统属性指定。
public KerberosPrincipal(String name, int nameType)
如果输入的名称不包含一个域,则使用默认的域。默认的域可以指定一个Kerberos配置文件或通过java.security.krb5.realm系统性能。更多信息,见 Kerberos Requirements。
name
-主的名字
nameType
-名称主要类型
IllegalArgumentException
如果名称是不正确的格式,如果是空的,如果nameType不支持,或者名称不包含领域使用默认的境界是不在任何一个Kerberos配置文件或通过java.security.krb5.realm系统属性指定。
public String getRealm()
public int hashCode()
hashCode = getName().hashCode();
hashCode
接口
Principal
hashCode
方法重写,继承类
Object
KerberosPrincipal
hashcode()
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object other)
KerberosPrincipal
和两
KerberosPrincipal
实例是等价的。如果返回的值是相等的
getName()
更正式的两
KerberosPrincipal
实例相等。
public int getNameType()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.