public interface SecretKey extends Key, Destroyable
此接口的提供者实现必须覆盖equals种hashCode从继承的方法Object使密钥是基于其基础的关键材料相比,而不是基于参考。 实现应该重写默认destroy种isDestroyed从方法Destroyable接口,使敏感的关键信息被销毁,清除,或在这些信息是不可变的,未引用的情况。 最后,由于SecretKey是Serializable ,实现也应该覆盖ObjectOutputStream.writeObject(java.lang.Object)以防止被破坏的键被序列化。
实现此接口的密钥返回字符串RAW作为其编码格式(参见getFormat ),并返回原始密钥字节作为getEncoded方法调用的结果。 ( getFormat和getEncoded方法从Key父接口继承。)
SecretKeyFactory , Cipher
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID
从J2SE 1.4起设置为指示序列化兼容性的类指纹。
|
getAlgorithm, getEncoded, getFormatdestroy, isDestroyedstatic final long serialVersionUID
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.