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!