JavaTM 2 Platform
Standard Ed. 6

java.security.spec
类 EncodedKeySpec

java.lang.Object
  继承者 java.security.spec.EncodedKeySpec
所有已实现的接口:
KeySpec
直接已知子类:
PKCS8EncodedKeySpec, X509EncodedKeySpec

public abstract class EncodedKeySpec
extends Object
implements KeySpec

此类用编码格式表示公用密钥或专用密钥。

从以下版本开始:
1.2
另请参见:
Key, KeyFactory, KeySpec, X509EncodedKeySpec, PKCS8EncodedKeySpec

构造方法摘要
EncodedKeySpec(byte[] encodedKey)
          根据给定的编码密钥创建一个新的 EncodedKeySpec。
 
方法摘要
 byte[] getEncoded()
          返回编码密钥。
abstract  String getFormat()
          返回与此密钥规范关联的编码格式的名称。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

EncodedKeySpec

public EncodedKeySpec(byte[] encodedKey)
根据给定的编码密钥创建一个新的 EncodedKeySpec。

参数:
encodedKey - 编码密钥。复制数组的内容,以防随后进行修改。
抛出:
NullPointerException - 如果 encodedKey 为 null。
方法详细信息

getEncoded

public byte[] getEncoded()
返回编码密钥。

返回:
编码密钥。每次调用此方法时,都返回一个新数组。

getFormat

public abstract String getFormat()
返回与此密钥规范关联的编码格式的名称。

如果可以将密钥的不透明表示形式(请参见 Key)转换(请参见 KeyFactory)为此密钥的规范(或它的子类),则对不透明密钥调用 getFormat 方法会返回与此密钥规范的 getFormat 方法相同的值。

返回:
该编码格式的字符串表示形式。

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only