public class PKCS8EncodedKeySpec extends EncodedKeySpec
PrivateKeyInfo
进行编码。
PrivateKeyInfo
语法在PKCS#8标准中定义如下:
PrivateKeyInfo ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] IMPLICIT Attributes OPTIONAL }
Version ::= INTEGER
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
Attributes ::= SET OF Attribute
Key
, KeyFactory
, KeySpec
, EncodedKeySpec
, X509EncodedKeySpec
Constructor and Description |
---|
PKCS8EncodedKeySpec(byte[] encodedKey)
使用给定的编码密钥创建一个新的PKCS8EncodedKeySpec。
|
public PKCS8EncodedKeySpec(byte[] encodedKey)
encodedKey
- 假设按照PKCS#8标准进行编码的密钥。
复制数组的内容以防止后续修改。
NullPointerException
- 如果
encodedKey
为空。
public byte[] getEncoded()
getEncoded
在
EncodedKeySpec
public final String getFormat()
getFormat
在
EncodedKeySpec
"PKCS#8"
。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.