-
- All Superinterfaces:
-
Destroyable,Key,Serializable
- All Known Subinterfaces:
-
PBEKey
- 所有已知实现类:
-
EncryptionKey,KerberosKey,SecretKeySpec
public interface SecretKey extends Key, Destroyable
一个秘密(对称)键。 该接口的目的是为所有密钥接口分组(并提供类型安全性)。该接口的提供者实现必须覆盖从
Object继承的equals和hashCode方法,从而基于其基础密钥材料比较密钥,而不是基于引用。 实现应该覆盖来自Destroyable接口的默认destroy和isDestroyed方法,以使敏感密钥信息被销毁,清除,或者在这种信息是不可变的,未引用的情况下。 最后,由于SecretKey是Serializable,实现还应该覆盖ObjectOutputStream.writeObject(java.lang.Object)以防止已被破坏的密钥被序列化。实现此接口的密钥返回字符串
RAW作为其编码格式(参见getFormat),并返回原始密钥字节作为getEncoded方法调用的结果。 (getFormat和getEncoded方法从Key父接口继承。)- 从以下版本开始:
- 1.4
- 另请参见:
-
SecretKeyFactory,Cipher
-
-
Field Summary
Fields Modifier and Type Field 描述 static longserialVersionUID从J2SE 1.4起设置为指示序列化兼容性的类指纹。
-
方法摘要
-
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
-
-
-
-
字段详细信息
-
serialVersionUID
static final long serialVersionUID
从J2SE 1.4起设置为指示序列化兼容性的类指纹。- 另请参见:
- Constant Field Values
-
-