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) |
|
|---|---|
java.security.spec.EncodedKeySpec
|
|
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". |