|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.security.Identity
java.security.KeyStore、java.security.cert 套件和 java.security.Principal 取代。
@Deprecated public abstract class Identity
此類別表示身份:現實世界的物件,比如人、公司或組織,它們的身份可以通過使用公鑰驗證。Identity 也可以是更抽象(或具體)的概念,例如守護執行緒或智能卡。
所有的 Identity 物件都具有一個名稱和一個公鑰。名稱是不可變的。Identity 也可以有作用域。也就是說,如果一個 Identity 被指定具有一個特定的作用域,那麼 Identity 的名稱和公鑰在該作用域內是唯一的。
Identity 也有一個證書集合(都證明其本身的公鑰)。只要密鑰相同,在這些證書中指定的主體名稱不必相同。
可以為 Identity 創建子類別,以包括郵政和電子郵件位址、電話號碼、面部圖像和徽標等等。
IdentityScope,
Signer,
Principal,
序列化表格| 建構子摘要 | |
|---|---|
protected |
Identity()
已過時。 只用於序列化的建構器。 |
|
Identity(String name)
已過時。 建構一個具有指定名稱且沒有作用域的 Identity。 |
|
Identity(String name,
IdentityScope scope)
已過時。 建構一個具有指定名稱和作用域的 Identity。 |
| 方法摘要 | |
|---|---|
void |
addCertificate(Certificate certificate)
已過時。 為此 Identity 添加一個證書。 |
Certificate[] |
certificates()
已過時。 返回此 Identity 所有證書的一個副本。 |
boolean |
equals(Object identity)
已過時。 測試指定對象與此 Identity 的相等性。 |
String |
getInfo()
已過時。 返回以前為此 Identity 指定的常規資訊字元串。 |
String |
getName()
已過時。 返回此 Identity 的名稱。 |
PublicKey |
getPublicKey()
已過時。 返回此 Identity 的公鑰。 |
IdentityScope |
getScope()
已過時。 返回此 Identity 的作用域。 |
int |
hashCode()
已過時。 返回此 Identity 的雜湊碼。 |
protected boolean |
identityEquals(Identity identity)
已過時。 測試指定 Identity 與此 Identity 的相等性。 |
void |
removeCertificate(Certificate certificate)
已過時。 從此 Identity 中移除證書。 |
void |
setInfo(String info)
已過時。 為此 Identity 指定一個常規資訊字元串。 |
void |
setPublicKey(PublicKey key)
已過時。 設置此 Identity 的公鑰。 |
String |
toString()
已過時。 返回描述此 Identity 的短字元串,說明其名稱和作用域(如果有的話)。 |
String |
toString(boolean detailed)
已過時。 返回此 Identity 的字元串表示形式,可以選擇比不帶任何參數的 toString 方法帶有更多的詳細資訊。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| 建構子詳細資訊 |
|---|
protected Identity()
public Identity(String name,
IdentityScope scope)
throws KeyManagementException
name - Identity 的名稱。scope - Identity 的作用域。
KeyManagementException - 在此作用域內已經存在一個具有相同名稱的 Identity。public Identity(String name)
name - Identity 的名稱。| 方法詳細資訊 |
|---|
public final String getName()
Principal 中的 getNamepublic final IdentityScope getScope()
public PublicKey getPublicKey()
setPublicKey(java.security.PublicKey)
public void setPublicKey(PublicKey key)
throws KeyManagementException
首先,如果存在安全管理器,則用 "setIdentityPublicKey" 作為參數調用其 checkSecurityAccess 方法,以查看它是否可以設置公鑰。
key - 此 Identity 的公鑰。
KeyManagementException - 如果在此 Identity 的作用域內的另外一個 Identity 具有相同的公鑰,或者發生其他異常。
SecurityException - 如果安全管理器存在並且其 checkSecurityAccess 方法不允許設置公鑰。getPublicKey(),
SecurityManager.checkSecurityAccess(java.lang.String)public void setInfo(String info)
首先,如果有安全管理器,則用 "setIdentityInfo" 作為參數調用其 checkSecurityAccess 方法,以查看它是否可以指定資訊字元串。
info - 資訊字元串。
SecurityException - 如果安全管理器存在並且其 checkSecurityAccess 方法不允許設置資訊字元串。getInfo(),
SecurityManager.checkSecurityAccess(java.lang.String)public String getInfo()
setInfo(java.lang.String)
public void addCertificate(Certificate certificate)
throws KeyManagementException
首先,如果存在安全管理器,則用 "addIdentityCertificate" 作為參數調用其 checkSecurityAccess 方法,以查看它是否可以添加一個證書。
certificate - 要添加的證書。
KeyManagementException - 如果證書是無效的;如果要添加到證書中的公鑰和此 Identity 衝突;如果發生其他異常。
SecurityException - 如果安全管理器存在並且其 checkSecurityAccess 方法不允許添加證書。SecurityManager.checkSecurityAccess(java.lang.String)
public void removeCertificate(Certificate certificate)
throws KeyManagementException
首先,如果存在安全管理器,則用 "removeIdentityCertificate" 作為參數調用其 checkSecurityAccess 方法,以查看它是否可以移除證書。
certificate - 要移除的證書。
KeyManagementException - 如果證書丟失,或者發生其他異常。
SecurityException - 如果安全管理器存在並且其 checkSecurityAccess 方法不允許移除證書。SecurityManager.checkSecurityAccess(java.lang.String)public Certificate[] certificates()
public final boolean equals(Object identity)
identityEquals。
Principal 中的 equalsObject 中的 equalsidentity - 要與此 Identity 進行相等性測試的物件。
identityEquals(java.security.Identity)protected boolean identityEquals(Identity identity)
identity - 要與此 Identity 進行相等性測試的 Identity。
equals(java.lang.Object)public String toString()
首先,如果存在安全管理器,則用 "printIdentity" 作為參數調用其 checkSecurityAccess 方法,以查看它是否可以返回字元串。
Principal 中的 toStringObject 中的 toStringSecurityException - 如果安全管理器存在並且其 checkSecurityAccess 方法不允許返回描述此 Identity 的字元串。SecurityManager.checkSecurityAccess(java.lang.String)public String toString(boolean detailed)
toString 方法帶有更多的詳細資訊。
首先,如果存在安全管理器,則用 "printIdentity" 作為參數調用其 checkSecurityAccess 方法,以查看它是否可以返回字元串。
detailed - 是否提供詳細的資訊。
detailed 為 true,那麼此方法比不帶任何參數的 toString 方法返回更多的資訊。
SecurityException - 如果安全管理器存在並且其 checkSecurityAccess 方法不允許返回描述此 Identity 的字元串。toString(),
SecurityManager.checkSecurityAccess(java.lang.String)public int hashCode()
Principal 中的 hashCodeObject 中的 hashCodeObject.equals(java.lang.Object),
Hashtable
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。