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 }
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
|
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. |
byte[] getEncoded ()
返回按照X.509标准编码的关键字节。
Returns | |
---|---|
byte[] |
the X.509 encoding of the key. Returns a new array each time this method is called. |
String getFormat ()
返回与此密钥规范关联的编码格式的名称。
Returns | |
---|---|
String |
the string "X.509" . |