Package java.security.spec
Class PKCS8EncodedKeySpec
java.lang.Object
java.security.spec.EncodedKeySpec
java.security.spec.PKCS8EncodedKeySpec
- All Implemented Interfaces:
KeySpec
public class PKCS8EncodedKeySpec extends EncodedKeySpec
The key specification for an encoded private key in ASN.1 format as defined
in the PKCS#8 standard.
-
Constructor Summary
Constructors Constructor Description PKCS8EncodedKeySpec(byte[] encodedKey)Creates a newPKCS8EncodedKeySpecwith the specified encoded key bytes. -
Method Summary
Modifier and Type Method Description byte[]getEncoded()Returns a copy of the encoded key bytes.StringgetFormat()Returns the name of the encoding format of this encoded key specification.
-
Constructor Details
-
PKCS8EncodedKeySpec
public PKCS8EncodedKeySpec(byte[] encodedKey)Creates a newPKCS8EncodedKeySpecwith the specified encoded key bytes.- Parameters:
encodedKey- the encoded key bytes.
-
-
Method Details
-
getEncoded
public byte[] getEncoded()Returns a copy of the encoded key bytes.- Overrides:
getEncodedin classEncodedKeySpec- Returns:
- a copy of the encoded key bytes.
-
getFormat
Returns the name of the encoding format of this encoded key specification.- Specified by:
getFormatin classEncodedKeySpec- Returns:
- the string "PKCS#8".
-