| Modifier and Type | Class and Description |
|---|---|
static class |
KeySelector.Purpose
要选择的键的目的。
|
| Modifier | Constructor and Description |
|---|---|
protected |
KeySelector()
默认的无参数构造函数;
仅供子类调用。
|
| Modifier and Type | Method and Description |
|---|---|
abstract KeySelectorResult |
select(KeyInfo keyInfo, KeySelector.Purpose purpose, AlgorithmMethod method, XMLCryptoContext context)
尝试找到满足指定约束的键。
|
static KeySelector |
singletonKeySelector(Key key)
返回
KeySelector总是选择指定密钥,不管的
KeyInfo传递给它。
|
public abstract KeySelectorResult select(KeyInfo keyInfo, KeySelector.Purpose purpose, AlgorithmMethod method, XMLCryptoContext context) throws KeySelectorException
keyInfo - a
KeyInfo (可能为
null )
purpose -密钥的目的(
KeySelector.Purpose.SIGN ,
KeySelector.Purpose.VERIFY ,
KeySelector.Purpose.ENCRYPT ,或
KeySelector.Purpose.DECRYPT )
method - 该密钥用于的算法方法。
应该只返回与算法兼容并满足指定算法约束的键。
context - 一个XMLCryptoContext可能包含有用的信息,找到一个合适的密钥。
如果此键选择器支持解析RetrievalMethod类型,则选择器将使用上下文的baseURI和dereferencer参数(如果指定)来解析和取消引用URI。
KeySelectorException - 如果尝试找到密钥时发生异常情况。
请注意,无法找到密钥不被视为异常(在这种情况下应返回null )。
然而,阻止KeySelector找到潜在密钥的错误状况(例如:网络通信故障)应被视为异常。
ClassCastException -如果数据类型
method不受此密钥选择器支持
public static KeySelector singletonKeySelector(Key key)
KeySelector总是选择指定密钥,不管的
KeyInfo传递给它。
key - 存储在键选择器中的唯一键
NullPointerException - if
key is
null
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.