| 
 | 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。