125 lines
6.0 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="Interface SecretKey">Interface SecretKey</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
All Superinterfaces:
</dt>
<dd>
<span><a href="../../javax/security/auth/Destroyable.html" title="javax.security.auth中的接口">Destroyable</a> <a href="../../java/security/Key.html" title="java.security中的接口">Key</a> <a href="../../java/io/Serializable.html" title="java.io中的接口">Serializable</a></span>
</dd>
</dl>
<dl>
<dt>
All Known Subinterfaces:
</dt>
<dd>
<span><a href="../../javax/crypto/interfaces/PBEKey.html" title="javax.crypto.interfaces中的接口">PBEKey</a></span>
</dd>
</dl>
<dl>
<dt>
所有已知实现类:
</dt>
<dd>
<span><a href="../../javax/security/auth/kerberos/KerberosKey.html" title="javax.security.auth.kerberos中的类">KerberosKey</a> <a href="../../javax/crypto/spec/SecretKeySpec.html" title="javax.crypto.spec中的类">SecretKeySpec</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public interface <span class="typeNameLabel">SecretKey</span>
extends <a href="../../java/security/Key.html" title="interface in java.security">Key</a>, <a href="../../javax/security/auth/Destroyable.html" title="interface in javax.security.auth">Destroyable</a></pre>
<div class="block">
<span>一个秘密(对称)键。</span>
<span>该接口的目的是为所有密钥接口分组(并提供类型安全性)。</span>
<p> <span>此接口的提供者实现必须覆盖<code>equals</code><code>hashCode</code>从继承的方法<a href="../../java/lang/Object.html" title="java.lang中的类"><code>Object</code></a>使密钥是基于其基础的关键材料相比,而不是基于参考。</span> <span>实现应该重写默认<code>destroy</code><code>isDestroyed</code>从方法<a href="../../javax/security/auth/Destroyable.html" title="javax.security.auth中的接口"><code>Destroyable</code></a>接口,使敏感的关键信息被销毁,清除,或在这些信息是不可变的,未引用的情况。</span> <span>最后,由于<code>SecretKey</code><code>Serializable</code> ,实现也应该覆盖<a href="../../java/io/ObjectOutputStream.html#writeObject-java.lang.Object-"><code>ObjectOutputStream.writeObject(java.lang.Object)</code></a>以防止被破坏的键被序列化。</span> </p>
<p> <span>实现此接口的密钥返回字符串<code>RAW</code>作为其编码格式(参见<code>getFormat</code> ),并返回原始密钥字节作为<code>getEncoded</code>方法调用的结果。</span> <span> <code>getFormat</code><code>getEncoded</code>方法从<a href="../../java/security/Key.html" title="java.security中的接口"><code>Key</code></a>父接口继承。)</span> </p>
</div>
<dl>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<span><a href="../../javax/crypto/SecretKeyFactory.html" title="javax.crypto中的类"><code>SecretKeyFactory</code></a> <a href="../../javax/crypto/Cipher.html" title="javax.crypto中的类"><code>Cipher</code></a></span>
</dd>
</dl> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- --> </a> <h3>Field Summary</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Field Summary table, listing fields, and an explanation">
<caption>
<span>Fields</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../javax/crypto/SecretKey.html#serialVersionUID">serialVersionUID</a></span></code>
<div class="block">
从J2SE 1.4起设置为指示序列化兼容性的类指纹。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.security.Key">
<!-- --> </a> <h3>Methods inherited from interface java.security.<a href="../../java/security/Key.html" title="interface in java.security">Key</a></h3> <code><a href="../../java/security/Key.html#getAlgorithm--">getAlgorithm</a>, <a href="../../java/security/Key.html#getEncoded--">getEncoded</a>, <a href="../../java/security/Key.html#getFormat--">getFormat</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.security.auth.Destroyable">
<!-- --> </a> <h3>Methods inherited from interface javax.security.auth.<a href="../../javax/security/auth/Destroyable.html" title="interface in javax.security.auth">Destroyable</a></h3> <code><a href="../../javax/security/auth/Destroyable.html#destroy--">destroy</a>, <a href="../../javax/security/auth/Destroyable.html#isDestroyed--">isDestroyed</a></code></li>
</ul> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- --> </a> <h3>字段详细信息</h3> <a name="serialVersionUID">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>serialVersionUID</h4> <pre>static final long serialVersionUID</pre>
<div class="block">
从J2SE 1.4起设置为指示序列化兼容性的类指纹。
</div>
<dl>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../constant-values.html#javax.crypto.SecretKey.serialVersionUID">Constant Field Values</a>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>