JavaTM 2 Platform
Standard Ed. 6

java.security.spec
类 X509EncodedKeySpec

java.lang.Object
  继承者 java.security.spec.EncodedKeySpec
      继承者 java.security.spec.X509EncodedKeySpec
所有已实现的接口:
KeySpec

public class X509EncodedKeySpec
extends EncodedKeySpec

此类表示根据 ASN.1 类型 SubjectPublicKeyInfo 进行编码的公用密钥的 ASN.1 编码。X.509 标准中定义的 SubjectPublicKeyInfo 语法如下:

 SubjectPublicKeyInfo ::= SEQUENCE {
   algorithm AlgorithmIdentifier,
   subjectPublicKey BIT STRING }
 

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

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

构造方法详细信息

X509EncodedKeySpec

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

参数:
encodedKey - 假设按照 X.509 标准对其进行编码的密钥。复制数组的内容,以防随后进行修改。
抛出:
NullPointerException - 如果 encodedKey 为 null。
方法详细信息

getEncoded

public byte[] getEncoded()
返回按照 X.509 标准进行编码的密钥的字节。

覆盖:
EncodedKeySpec 中的 getEncoded
返回:
密钥的 X.509 编码。每次调用此方法时,都返回一个新数组。

getFormat

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

指定者:
EncodedKeySpec 中的 getFormat
返回:
字符串 "X.509"

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

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