| 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 -
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 -被存储在关键选择的唯一关键
null
key
NullPointerException
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.