Most visited

Recently visited

Added in API level 1

X509EncodedKeySpec

public class X509EncodedKeySpec
extends EncodedKeySpec

java.lang.Object
    java.security.spec.EncodedKeySpec
      java.security.spec.X509EncodedKeySpec


该类表示公钥的ASN.1编码,根据ASN.1类型SubjectPublicKeyInfo编码。 在X.509标准中定义了SubjectPublicKeyInfo语法,如下所示:

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

也可以看看:

摘要(Summary)

Public constructors

X509EncodedKeySpec(byte[] encodedKey)

使用给定的编码密钥创建新的X509EncodedKeySpec。

公共方法(Public methods)

byte[] getEncoded()

返回按照X.509标准编码的关键字节。

final String getFormat()

返回与此密钥规范关联的编码格式的名称。

继承方法(Inherited methods)

From class java.security.spec.EncodedKeySpec
From class java.lang.Object

Public constructors

X509EncodedKeySpec

Added in API level 1
X509EncodedKeySpec (byte[] encodedKey)

使用给定的编码密钥创建新的X509EncodedKeySpec。

参数(Parameters)
encodedKey byte: the key, which is assumed to be encoded according to the X.509 standard. The contents of the array are copied to protect against subsequent modification.
抛出异常(Throws)
NullPointerException if encodedKey is null.

公共方法(Public methods)

getEncoded

Added in API level 1
byte[] getEncoded ()

返回按照X.509标准编码的关键字节。

返回(Returns)
byte[] the X.509 encoding of the key. Returns a new array each time this method is called.

getFormat

Added in API level 1
String getFormat ()

返回与此密钥规范关联的编码格式的名称。

返回(Returns)
String the string "X.509".

Hooray!