|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.xml.crypto.KeySelector
public abstract class KeySelector
一個選擇器,可使用 KeyInfo 物件中包含的資料尋找並返回某個密鑰。此類別實作的一個範例是:搜尋與 KeyInfo 中所含資訊相比對的受信任密鑰的 KeyStore。
返回的密鑰是否受信任,以及用來確定的機制是特定於實作的。
| 巢狀類別摘要 | |
|---|---|
static class |
KeySelector.Purpose
將被選中的密鑰的用途。 |
| 建構子摘要 | |
|---|---|
protected |
KeySelector()
預設的不帶參數的建構子;僅由子類別調用。 |
| 方法摘要 | |
|---|---|
abstract KeySelectorResult |
select(KeyInfo keyInfo,
KeySelector.Purpose purpose,
AlgorithmMethod method,
XMLCryptoContext context)
嘗試尋找滿足指定約束的密鑰。 |
static KeySelector |
singletonKeySelector(Key key)
返回一個總是選擇指定密鑰的 KeySelector,不管傳遞給它的 KeyInfo 是什麼。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
protected KeySelector()
| 方法詳細資訊 |
|---|
public abstract KeySelectorResult select(KeyInfo keyInfo,
KeySelector.Purpose purpose,
AlgorithmMethod method,
XMLCryptoContext context)
throws KeySelectorException
keyInfo - 一個 KeyInfo(可以為 null)purpose - 密鑰的用途(KeySelector.Purpose.SIGN、KeySelector.Purpose.VERIFY、KeySelector.Purpose.ENCRYPT 或 KeySelector.Purpose.DECRYPT)method - 使用此密鑰的演算法方法。應該只返回與演算法相容且滿足指定演算法的約束條件的密鑰。context - 可能包含對尋找某一適當密鑰有用的資訊的 XMLCryptoContext。如果此密鑰選擇器支持解析 RetrievalMethod 型別,則選擇器應該使用上下文的 baseURI 和 dereferencer 參數(如果指定)來解析 URI,並取消對 URI 的參考。
KeySelectorException - 如果試圖尋找某個密鑰時發生異常條件。注意,無法尋找密鑰不被視為異常(在這種情況下,應該返回 null)。但是,阻止 KeySelector 尋找某個可能密鑰的錯誤條件(例如:網路通訊失敗)應被視為異常。
ClassCastException - 如果 method 的資料型別不受此密鑰選擇器支持。public static KeySelector singletonKeySelector(Key key)
KeySelector,不管傳遞給它的 KeyInfo 是什麼。
key - 將存儲到密鑰選擇器中的單獨密鑰
NullPointerException - 如果 key 為 null
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。