uTools-Manuals/docs/java/javax/crypto/ExemptionMechanism.html

696 lines
36 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">
javax.crypto
</div>
<h2 class="title" title="Class ExemptionMechanism">Class ExemptionMechanism</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.crypto.ExemptionMechanism</li>
</ul> </li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public class <span class="typeNameLabel">ExemptionMechanism</span>
extends <a href="../../java/lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">
<span>这个类提供了豁免机制的功能,其中的例子是<i>密钥恢复</i> <i>密钥弱化</i><i>密钥托管</i></span>
<p> <span>使用豁免机制的应用程序或小程序可能被授予比没有加密功能的更强的加密能力。</span> </p>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== 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/crypto/ExemptionMechanism.html#ExemptionMechanism-javax.crypto.ExemptionMechanismSpi-java.security.Provider-java.lang.String-">ExemptionMechanism</a></span>(<a href="../../javax/crypto/ExemptionMechanismSpi.html" title="class in javax.crypto">ExemptionMechanismSpi</a> exmechSpi, <a href="../../java/security/Provider.html" title="class in java.security">Provider</a> provider, <a href="../../java/lang/String.html" title="class in java.lang">String</a> mechanism)</code>
<div class="block">
创建一个ExemptionMechanism对象。
</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="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>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#finalize--">finalize</a></span>()</code>
<div class="block">
确保当这个ExemptionMechanism对象存储的密钥在没有更多的引用时被清除。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#genExemptionBlob--">genExemptionBlob</a></span>()</code>
<div class="block">
生成豁免机制密钥blob。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#genExemptionBlob-byte:A-">genExemptionBlob</a></span>(byte[] output)</code>
<div class="block">
生成豁免机制密钥blob并将结果存储在
<code>output</code>缓冲区中。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#genExemptionBlob-byte:A-int-">genExemptionBlob</a></span>(byte[] output, int outputOffset)</code>
<div class="block">
生成豁免机制密钥blob并将结果存储在
<code>output</code>缓冲区中,从
<code>outputOffset</code>开始。
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>static <a href="../../javax/crypto/ExemptionMechanism.html" title="class in javax.crypto">ExemptionMechanism</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#getInstance-java.lang.String-">getInstance</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a> algorithm)</code>
<div class="block">
返回实现指定的
<code>ExemptionMechanism</code>对象。
</div> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>static <a href="../../javax/crypto/ExemptionMechanism.html" title="class in javax.crypto">ExemptionMechanism</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#getInstance-java.lang.String-java.security.Provider-">getInstance</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a> algorithm, <a href="../../java/security/Provider.html" title="class in java.security">Provider</a> provider)</code>
<div class="block">
返回一个
<code>ExemptionMechanism</code>指定的豁免机制算法的
<code>ExemptionMechanism</code>对象。
</div> </td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>static <a href="../../javax/crypto/ExemptionMechanism.html" title="class in javax.crypto">ExemptionMechanism</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#getInstance-java.lang.String-java.lang.String-">getInstance</a></span>(<a href="../../java/lang/String.html" title="class in java.lang">String</a> algorithm, <a href="../../java/lang/String.html" title="class in java.lang">String</a> provider)</code>
<div class="block">
返回实现指定的
<code>ExemptionMechanism</code>对象。
</div> </td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code><a href="../../java/lang/String.html" title="class in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#getName--">getName</a></span>()</code>
<div class="block">
返回此
<code>ExemptionMechanism</code>对象的豁免机制名称。
</div> </td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#getOutputSize-int-">getOutputSize</a></span>(int inputLen)</code>
<div class="block">
给定输入长度
<code>inputLen</code> (以字节为单位),返回输出缓冲区需要保留下一个
<a href="../../javax/crypto/ExemptionMechanism.html#genExemptionBlob-byte:A-"><code>genExemptionBlob</code></a>操作结果的字节长度。
</div> </td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code><a href="../../java/security/Provider.html" title="class in java.security">Provider</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#getProvider--">getProvider</a></span>()</code>
<div class="block">
返回此
<code>ExemptionMechanism</code>对象的提供者。
</div> </td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#init-java.security.Key-">init</a></span>(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key)</code>
<div class="block">
使用密钥初始化此豁免机制。
</div> </td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#init-java.security.Key-java.security.AlgorithmParameters-">init</a></span>(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key, <a href="../../java/security/AlgorithmParameters.html" title="class in java.security">AlgorithmParameters</a> params)</code>
<div class="block">
使用密钥和一组算法参数初始化此豁免机制。
</div> </td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#init-java.security.Key-java.security.spec.AlgorithmParameterSpec-">init</a></span>(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key, <a href="../../java/security/spec/AlgorithmParameterSpec.html" title="interface in java.security.spec">AlgorithmParameterSpec</a> params)</code>
<div class="block">
使用密钥和一组算法参数初始化此豁免机制。
</div> </td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/ExemptionMechanism.html#isCryptoAllowed-java.security.Key-">isCryptoAllowed</a></span>(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key)</code>
<div class="block">
返回此豁免机制是否已成功生成结果blob。
</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#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="ExemptionMechanism-javax.crypto.ExemptionMechanismSpi-java.security.Provider-java.lang.String-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>ExemptionMechanism</h4> <pre>protected ExemptionMechanism(<a href="../../javax/crypto/ExemptionMechanismSpi.html" title="class in javax.crypto">ExemptionMechanismSpi</a> exmechSpi,
<a href="../../java/security/Provider.html" title="class in java.security">Provider</a> provider,
<a href="../../java/lang/String.html" title="class in java.lang">String</a> mechanism)</pre>
<div class="block">
创建一个ExemptionMechanism对象。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>exmechSpi</code> - 代表
</dd>
<dd>
<code>provider</code> - 提供商
</dd>
<dd>
<code>mechanism</code> - 豁免机制
</dd>
</dl> </li>
</ul> </li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getName--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getName</h4> <pre>public final <a href="../../java/lang/String.html" title="class in java.lang">String</a> getName()</pre>
<div class="block">
<span>返回此<code>ExemptionMechanism</code>对象的豁免机制名称。</span>
<p> <span>这是在创建此<code>ExemptionMechanism</code>对象的<code>getInstance</code>调用之一中指定的<code>getInstance</code></span> </p>
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>ExemptionMechanism</code>对象的豁免机制名称。
</dd>
</dl> </li>
</ul> <a name="getInstance-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getInstance</h4> <pre>public static final <a href="../../javax/crypto/ExemptionMechanism.html" title="class in javax.crypto">ExemptionMechanism</a> getInstance(<a href="../../java/lang/String.html" title="class in java.lang">String</a> algorithm)
throws <a href="../../java/security/NoSuchAlgorithmException.html" title="class in java.security">NoSuchAlgorithmException</a></pre>
<div class="block">
<span>返回实现指定的<code>ExemptionMechanism</code>对象。</span>
<p> <span>此方法遍历已注册的安全提供程序列表,从最优选的提供程序开始。</span> <span>返回从支持指定算法的第一个Provider中封装ExemptionMechanismSpi实现的新的ExemptionMechanism对象。</span> </p>
<p> <span>请注意,注册提供商的列表可以通过<a href="../../java/security/Security.html#getProviders--"><code>Security.getProviders()</code></a>方法<a href="../../java/security/Security.html#getProviders--">检索</a></span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>algorithm</code> - 请求的豁免机制的标准名称。</span>
<span>有关标准豁免机制名称的信息请参阅Java Cryptography Architecture Standard Algorithm Name Documentation中的<a href="../../../technotes/guides/security/StandardNames.html#Exemption">豁免</a>机制部分。</span>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
新的
<code>ExemptionMechanism</code>对象。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - 如果
<code>algorithm</code>为空。
</dd>
<dd>
<code><a href="../../java/security/NoSuchAlgorithmException.html" title="class in java.security">NoSuchAlgorithmException</a></code> - 如果没有提供者支持指定算法的ExemptionMechanismSpi实现。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../java/security/Provider.html" title="java.security中的类"><code>Provider</code></a></span>
</dd>
</dl> </li>
</ul> <a name="getInstance-java.lang.String-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getInstance</h4> <pre>public static final <a href="../../javax/crypto/ExemptionMechanism.html" title="class in javax.crypto">ExemptionMechanism</a> getInstance(<a href="../../java/lang/String.html" title="class in java.lang">String</a> algorithm,
<a href="../../java/lang/String.html" title="class in java.lang">String</a> provider)
throws <a href="../../java/security/NoSuchAlgorithmException.html" title="class in java.security">NoSuchAlgorithmException</a>,
<a href="../../java/security/NoSuchProviderException.html" title="class in java.security">NoSuchProviderException</a></pre>
<div class="block">
<span>返回一个<code>ExemptionMechanism</code>指定的免除机制算法的<code>ExemptionMechanism</code>对象。</span>
<p> <span>返回从指定的提供程序封装ExemptionMechanismSpi实现的新的ExemptionMechanism对象。</span> <span>指定的提供者必须在安全提供程序列表中注册。</span> </p>
<p> <span>请注意,注册提供商的列表可以通过<a href="../../java/security/Security.html#getProviders--"><code>Security.getProviders()</code></a>方法<a href="../../java/security/Security.html#getProviders--">检索</a></span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>algorithm</code> - 请求豁免机制的标准名称。</span>
<span>有关标准豁免机制名称的信息请参阅Java Cryptography Architecture Standard Algorithm Name Documentation中的<a href="../../../technotes/guides/security/StandardNames.html#Exemption">豁免</a>机制部分。</span>
</dd>
<dd>
<code>provider</code> - 提供者的名称。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
新的
<code>ExemptionMechanism</code>对象。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - 如果
<code>algorithm</code>为空。
</dd>
<dd>
<code><a href="../../java/security/NoSuchAlgorithmException.html" title="class in java.security">NoSuchAlgorithmException</a></code> - 如果指定的算法的ExemptionMechanismSpi实现从指定的提供程序中不可用。
</dd>
<dd>
<code><a href="../../java/security/NoSuchProviderException.html" title="class in java.security">NoSuchProviderException</a></code> - 如果指定的提供程序未在安全提供程序列表中注册。
</dd>
<dd>
<code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 如果
<code>provider</code>为空或为空。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../java/security/Provider.html" title="java.security中的类"><code>Provider</code></a></span>
</dd>
</dl> </li>
</ul> <a name="getInstance-java.lang.String-java.security.Provider-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getInstance</h4> <pre>public static final <a href="../../javax/crypto/ExemptionMechanism.html" title="class in javax.crypto">ExemptionMechanism</a> getInstance(<a href="../../java/lang/String.html" title="class in java.lang">String</a> algorithm,
<a href="../../java/security/Provider.html" title="class in java.security">Provider</a> provider)
throws <a href="../../java/security/NoSuchAlgorithmException.html" title="class in java.security">NoSuchAlgorithmException</a></pre>
<div class="block">
<span>返回实现指定的<code>ExemptionMechanism</code>对象。</span>
<p> <span>返回从指定的Provider对象封装ExemptionMechanismSpi实现的新的ExemptionMechanism对象。</span> <span>请注意指定的Provider对象不必在提供者列表中注册。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<span><code>algorithm</code> - 请求的豁免机制的标准名称。</span>
<span>有关标准豁免机制名称的信息请参阅Java Cryptography Architecture Standard Algorithm Name Documentation中的“ <a href="../../../technotes/guides/security/StandardNames.html#Exemption">豁免</a>机制”部分。</span>
</dd>
<dd>
<code>provider</code> - 提供商。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
新的
<code>ExemptionMechanism</code>对象。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - 如果
<code>algorithm</code>为空。
</dd>
<dd>
<code><a href="../../java/security/NoSuchAlgorithmException.html" title="class in java.security">NoSuchAlgorithmException</a></code> - 如果指定的算法的ExemptionMechanismSpi实现从指定的Provider对象不可用。
</dd>
<dd>
<code><a href="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - 如果
<code>provider</code>为空。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../java/security/Provider.html" title="java.security中的类"><code>Provider</code></a></span>
</dd>
</dl> </li>
</ul> <a name="getProvider--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getProvider</h4> <pre>public final <a href="../../java/security/Provider.html" title="class in java.security">Provider</a> getProvider()</pre>
<div class="block">
返回此
<code>ExemptionMechanism</code>对象的提供者。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
这个
<code>ExemptionMechanism</code>对象的提供者。
</dd>
</dl> </li>
</ul> <a name="isCryptoAllowed-java.security.Key-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isCryptoAllowed</h4> <pre>public final boolean isCryptoAllowed(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key)
throws <a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
<span>返回此豁免机制是否已成功生成结果blob。</span>
<p> <span>该方法还确保传入的密钥与初始化和生成阶段中使用的豁免机制相同。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>key</code> - 密码将要使用的密钥。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>该豁免机制是否成功生成了同一关键字的结果库;</span>
<span>如果<code>key</code>为空则为false。</span>
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在确定结果blob是否已被此豁免机制对象成功生成时遇到问题。
</dd>
</dl> </li>
</ul> <a name="getOutputSize-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getOutputSize</h4> <pre>public final int getOutputSize(int inputLen)
throws <a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a></pre>
<div class="block">
<span>给定输入长度<code>inputLen</code> (以字节为单位),返回输出缓冲区需要保存下一个<a href="../../javax/crypto/ExemptionMechanism.html#genExemptionBlob-byte:A-"><code>genExemptionBlob</code></a>操作结果的字节长度。</span>
<p> <span>下一个<a href="../../javax/crypto/ExemptionMechanism.html#genExemptionBlob-byte:A-"><code>genExemptionBlob</code></a>调用的实际输出长度可能小于此方法返回的长度。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>inputLen</code> - 输入长度(以字节为单位)
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
所需的输出缓冲区大小(以字节为单位)
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> - 如果此豁免机制处于错误状态(例如尚未初始化)
</dd>
</dl> </li>
</ul> <a name="init-java.security.Key-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>init</h4> <pre>public final void init(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key)
throws <a href="../../java/security/InvalidKeyException.html" title="class in java.security">InvalidKeyException</a>,
<a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
<span>使用密钥初始化此豁免机制。</span>
<p> <span>如果此豁免机制需要不能从给定的<code>key</code>派生的任何<code>key</code> ,则基础豁免机制实现应该自身生成所需参数(使用提供者特定的默认值);</span> <span>在的情况下算法参数必须由呼叫者指定,一个<code>InvalidKeyException</code>上升。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>key</code> - 这个豁免机制的关键
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/security/InvalidKeyException.html" title="class in java.security">InvalidKeyException</a></code> - 如果给定的密钥不适用于此豁免机制。
</dd>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在初始化过程中遇到问题。
</dd>
</dl> </li>
</ul> <a name="init-java.security.Key-java.security.spec.AlgorithmParameterSpec-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>init</h4> <pre>public final void init(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key,
<a href="../../java/security/spec/AlgorithmParameterSpec.html" title="interface in java.security.spec">AlgorithmParameterSpec</a> params)
throws <a href="../../java/security/InvalidKeyException.html" title="class in java.security">InvalidKeyException</a>,
<a href="../../java/security/InvalidAlgorithmParameterException.html" title="class in java.security">InvalidAlgorithmParameterException</a>,
<a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
<span>使用密钥和一组算法参数初始化此豁免机制。</span>
<p> <span>如果此豁免机制需要任何算法参数,并且<code>params</code>为空,则基础豁免机制实现应该自身生成所需参数(使用提供者特定的默认值);</span> <span>在的情况下算法参数必须由呼叫者指定,一个<code>InvalidAlgorithmParameterException</code>上升。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>key</code> - 这个豁免机制的关键
</dd>
<dd>
<code>params</code> - 算法参数
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/security/InvalidKeyException.html" title="class in java.security">InvalidKeyException</a></code> - 如果给定的密钥不适用于此豁免机制。
</dd>
<dd>
<code><a href="../../java/security/InvalidAlgorithmParameterException.html" title="class in java.security">InvalidAlgorithmParameterException</a></code> - 如果给定的算法参数不适用于此豁免机制。
</dd>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在初始化过程中遇到问题。
</dd>
</dl> </li>
</ul> <a name="init-java.security.Key-java.security.AlgorithmParameters-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>init</h4> <pre>public final void init(<a href="../../java/security/Key.html" title="interface in java.security">Key</a> key,
<a href="../../java/security/AlgorithmParameters.html" title="class in java.security">AlgorithmParameters</a> params)
throws <a href="../../java/security/InvalidKeyException.html" title="class in java.security">InvalidKeyException</a>,
<a href="../../java/security/InvalidAlgorithmParameterException.html" title="class in java.security">InvalidAlgorithmParameterException</a>,
<a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
<span>使用密钥和一组算法参数初始化此豁免机制。</span>
<p> <span>如果此豁免机制需要任何算法参数,并且<code>params</code>为null则基础豁免机制实现应该自身生成所需参数使用提供者特定的默认值;</span> <span>在的情况下算法参数必须由呼叫者指定,一个<code>InvalidAlgorithmParameterException</code>上升。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>key</code> - 这个豁免机制的关键
</dd>
<dd>
<code>params</code> - 算法参数
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/security/InvalidKeyException.html" title="class in java.security">InvalidKeyException</a></code> - 如果给定的密钥不适用于此豁免机制。
</dd>
<dd>
<code><a href="../../java/security/InvalidAlgorithmParameterException.html" title="class in java.security">InvalidAlgorithmParameterException</a></code> - 如果给定的算法参数不适用于此豁免机制。
</dd>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在初始化过程中遇到问题。
</dd>
</dl> </li>
</ul> <a name="genExemptionBlob--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>genExemptionBlob</h4> <pre>public final byte[] genExemptionBlob()
throws <a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a>,
<a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
生成豁免机制密钥blob。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
具有结果键blob的新缓冲区。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> - 如果此豁免机制处于错误状态(例如,尚未初始化)。
</dd>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在生成过程中遇到问题。
</dd>
</dl> </li>
</ul> <a name="genExemptionBlob-byte:A-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>genExemptionBlob</h4> <pre>public final int genExemptionBlob(byte[] output)
throws <a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a>,
<a href="../../javax/crypto/ShortBufferException.html" title="class in javax.crypto">ShortBufferException</a>,
<a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
<span>生成豁免机制密钥blob并将结果存储在<code>output</code>缓冲区中。</span>
<p> <span>如果<code>output</code>缓冲区太小而不能保存结果,则抛出<code>ShortBufferException</code></span> <span>在这种情况下,使用较大的输出缓冲区重复此呼叫。</span> <span>使用<a href="../../javax/crypto/ExemptionMechanism.html#getOutputSize-int-"><code>getOutputSize</code></a>来确定输出缓冲区应该有多大。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>output</code> - 结果的缓冲区
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
存储在
<code>output</code>中的字节数
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> - 如果此豁免机制处于错误状态(例如,尚未初始化)。
</dd>
<dd>
<code><a href="../../javax/crypto/ShortBufferException.html" title="class in javax.crypto">ShortBufferException</a></code> - 如果给定的输出缓冲区太小,不能保存结果。
</dd>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在生成过程中遇到问题。
</dd>
</dl> </li>
</ul> <a name="genExemptionBlob-byte:A-int-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>genExemptionBlob</h4> <pre>public final int genExemptionBlob(byte[] output,
int outputOffset)
throws <a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a>,
<a href="../../javax/crypto/ShortBufferException.html" title="class in javax.crypto">ShortBufferException</a>,
<a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></pre>
<div class="block">
<span>生成豁免机制密钥blob并将结果存储在<code>output</code>缓冲区中,从<code>outputOffset</code>开始。</span>
<p> <span>如果<code>output</code>缓冲区太小,无法保存结果,则会抛出一个<code>ShortBufferException</code></span> <span>在这种情况下,使用较大的输出缓冲区重复此呼叫。</span> <span>使用<a href="../../javax/crypto/ExemptionMechanism.html#getOutputSize-int-"><code>getOutputSize</code></a>确定输出缓冲区应该有多大。</span> </p>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>output</code> - 结果的缓冲区
</dd>
<dd>
<code>outputOffset</code> -
<code>output</code>中存储结果的偏移量
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
存储在
<code>output</code>中的字节数
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> - 如果此豁免机制处于错误状态(例如,尚未初始化)。
</dd>
<dd>
<code><a href="../../javax/crypto/ShortBufferException.html" title="class in javax.crypto">ShortBufferException</a></code> - 如果给定的输出缓冲区太小,不能保存结果。
</dd>
<dd>
<code><a href="../../javax/crypto/ExemptionMechanismException.html" title="class in javax.crypto">ExemptionMechanismException</a></code> - 如果在生成过程中遇到问题。
</dd>
</dl> </li>
</ul> <a name="finalize--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>finalize</h4> <pre>protected void finalize()</pre>
<div class="block">
确保当这个ExemptionMechanism对象存储的密钥在没有更多的引用时被清除。
</div>
<dl>
<dt>
<span class="overrideSpecifyLabel">重写:</span>
</dt>
<dd>
<code><a href="../../java/lang/Object.html#finalize--">finalize</a></code>在类别
<code><a href="../../java/lang/Object.html" title="class in java.lang">Object</a></code>
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../java/lang/ref/WeakReference.html" title="java.lang.ref中的类"><code>WeakReference</code></a> <a href="../../java/lang/ref/PhantomReference.html" title="java.lang.ref中的类"><code>PhantomReference</code></a></span>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>