uTools-Manuals/docs/java/javax/xml/crypto/KeySelector.html

239 lines
12 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
compact3
</div>
<div class="subTitle">
javax.xml.crypto
</div>
<h2 class="title" title="Class KeySelector">Class KeySelector</h2>
</div><div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>javax.xml.crypto.KeySelector</li>
</ul> </li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public abstract class <span class="typeNameLabel">KeySelector</span>
extends <a href="../../../java/lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">
<span>使用<a href="../../../javax/xml/crypto/dsig/keyinfo/KeyInfo.html" title="javax.xml.crypto.dsig.keyinfo中的接口"><code>KeyInfo</code></a>对象中包含的数据查找并返回键的选择器。</span>
<span>此类的实现示例是搜索<a href="../../../java/security/KeyStore.html" title="java.security中的类"><code>KeyStore</code></a>中与KeyInfo中包含的<code>KeyInfo</code>匹配的信任密钥的<code>KeyInfo</code></span>
<p> <span>返回的关键字是否被信任,以及用于确定哪些是实现特定的机制。</span> </p>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.6
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- --> </a> <h3>Nested Class Summary</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption>
<span>Nested Classes</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/crypto/KeySelector.Purpose.html" title="class in javax.xml.crypto">KeySelector.Purpose</a></span></code>
<div class="block">
要选择的键的目的。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- --> </a> <h3>构造方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
<caption>
<span>构造方法</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/crypto/KeySelector.html#KeySelector--">KeySelector</a></span>()</code>
<div class="block">
<span>默认的无参数构造函数;</span>
<span>仅供子类调用。</span>
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t1"><span><a href="javascript:show(1);">静态方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t4"><span><a href="javascript:show(8);">具体的方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code>abstract <a href="../../../javax/xml/crypto/KeySelectorResult.html" title="interface in javax.xml.crypto">KeySelectorResult</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/crypto/KeySelector.html#select-javax.xml.crypto.dsig.keyinfo.KeyInfo-javax.xml.crypto.KeySelector.Purpose-javax.xml.crypto.AlgorithmMethod-javax.xml.crypto.XMLCryptoContext-">select</a></span>(<a href="../../../javax/xml/crypto/dsig/keyinfo/KeyInfo.html" title="interface in javax.xml.crypto.dsig.keyinfo">KeyInfo</a> keyInfo, <a href="../../../javax/xml/crypto/KeySelector.Purpose.html" title="class in javax.xml.crypto">KeySelector.Purpose</a> purpose, <a href="../../../javax/xml/crypto/AlgorithmMethod.html" title="interface in javax.xml.crypto">AlgorithmMethod</a> method, <a href="../../../javax/xml/crypto/XMLCryptoContext.html" title="interface in javax.xml.crypto">XMLCryptoContext</a> context)</code>
<div class="block">
尝试找到满足指定约束的键。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>static <a href="../../../javax/xml/crypto/KeySelector.html" title="class in javax.xml.crypto">KeySelector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/xml/crypto/KeySelector.html#singletonKeySelector-java.security.Key-">singletonKeySelector</a></span>(<a href="../../../java/security/Key.html" title="interface in java.security">Key</a> key)</code>
<div class="block">
返回
<code>KeySelector</code>总是选择指定密钥,不管的
<code>KeyInfo</code>传递给它。
</div> </td>
</tr>
</tbody>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- --> </a> <h3>Methods inherited from class java.lang.<a href="../../../java/lang/Object.html" title="class in java.lang">Object</a></h3> <code><a href="../../../java/lang/Object.html#clone--">clone</a>, <a href="../../../java/lang/Object.html#equals-java.lang.Object-">equals</a>, <a href="../../../java/lang/Object.html#finalize--">finalize</a>, <a href="../../../java/lang/Object.html#getClass--">getClass</a>, <a href="../../../java/lang/Object.html#hashCode--">hashCode</a>, <a href="../../../java/lang/Object.html#notify--">notify</a>, <a href="../../../java/lang/Object.html#notifyAll--">notifyAll</a>, <a href="../../../java/lang/Object.html#toString--">toString</a>, <a href="../../../java/lang/Object.html#wait--">wait</a>, <a href="../../../java/lang/Object.html#wait-long-">wait</a>, <a href="../../../java/lang/Object.html#wait-long-int-">wait</a></code></li>
</ul> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- --> </a> <h3>构造方法详细信息</h3> <a name="KeySelector--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>KeySelector</h4> <pre>protected KeySelector()</pre>
<div class="block">
<span>默认的无参数构造函数;</span>
<span>仅供子类调用。</span>
</div> </li>
</ul> </li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="select-javax.xml.crypto.dsig.keyinfo.KeyInfo-javax.xml.crypto.KeySelector.Purpose-javax.xml.crypto.AlgorithmMethod-javax.xml.crypto.XMLCryptoContext-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>select</h4> <pre>public abstract <a href="../../../javax/xml/crypto/KeySelectorResult.html" title="interface in javax.xml.crypto">KeySelectorResult</a> select(<a href="../../../javax/xml/crypto/dsig/keyinfo/KeyInfo.html" title="interface in javax.xml.crypto.dsig.keyinfo">KeyInfo</a> keyInfo,
<a href="../../../javax/xml/crypto/KeySelector.Purpose.html" title="class in javax.xml.crypto">KeySelector.Purpose</a> purpose,
<a href="../../../javax/xml/crypto/AlgorithmMethod.html" title="interface in javax.xml.crypto">AlgorithmMethod</a> method,
<a href="../../../javax/xml/crypto/XMLCryptoContext.html" title="interface in javax.xml.crypto">XMLCryptoContext</a> context)
throws <a href="../../../javax/xml/crypto/KeySelectorException.html" title="class in javax.xml.crypto">KeySelectorException</a></pre>
<div class="block">
尝试找到满足指定约束的键。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>keyInfo</code> - a
<code>KeyInfo</code> (可能为
<code>null</code>
</dd>
<dd>
<code>purpose</code> -密钥的目的(
<a href="../../../javax/xml/crypto/KeySelector.Purpose.html#SIGN"><code>KeySelector.Purpose.SIGN</code></a>
<a href="../../../javax/xml/crypto/KeySelector.Purpose.html#VERIFY"><code>KeySelector.Purpose.VERIFY</code></a>
<a href="../../../javax/xml/crypto/KeySelector.Purpose.html#ENCRYPT"><code>KeySelector.Purpose.ENCRYPT</code></a> ,或
<a href="../../../javax/xml/crypto/KeySelector.Purpose.html#DECRYPT"><code>KeySelector.Purpose.DECRYPT</code></a>
</dd>
<dd>
<span><code>method</code> - 该密钥用于的算法方法。</span>
<span>应该只返回与算法兼容并满足指定算法约束的键。</span>
</dd>
<dd>
<span><code>context</code> - 一个<code>XMLCryptoContext</code>可能包含有用的信息,找到一个合适的密钥。</span>
<span>如果此键选择器支持解析<a href="../../../javax/xml/crypto/dsig/keyinfo/RetrievalMethod.html" title="javax.xml.crypto.dsig.keyinfo中的接口"><code>RetrievalMethod</code></a>类型,则选择器将使用上下文的<code>baseURI</code><code>dereferencer</code>参数如果指定来解析和取消引用URI。</span>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
键选择器的结果
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<span><code><a href="../../../javax/xml/crypto/KeySelectorException.html" title="class in javax.xml.crypto">KeySelectorException</a></code> - 如果尝试找到密钥时发生异常情况。</span>
<span>请注意,无法找到密钥不被视为异常(在这种情况下应返回<code>null</code> )。</span>
<span>然而,阻止<code>KeySelector</code>找到潜在密钥的错误状况(例如:网络通信故障)应被视为异常。</span>
</dd>
<dd>
<code><a href="../../../java/lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> -如果数据类型
<code>method</code>不受此密钥选择器支持
</dd>
</dl> </li>
</ul> <a name="singletonKeySelector-java.security.Key-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>singletonKeySelector</h4> <pre>public static <a href="../../../javax/xml/crypto/KeySelector.html" title="class in javax.xml.crypto">KeySelector</a> singletonKeySelector(<a href="../../../java/security/Key.html" title="interface in java.security">Key</a> key)</pre>
<div class="block">
返回
<code>KeySelector</code>总是选择指定密钥,不管的
<code>KeyInfo</code>传递给它。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>key</code> - 存储在键选择器中的唯一键
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个总是选择指定键的键选择器
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if
<code>key</code> is
<code>null</code>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>