EncryptedPrivateKeyInfo (Java SE 15 & JDK 15) (original) (raw)


public class EncryptedPrivateKeyInfo extends Object

This class implements the EncryptedPrivateKeyInfo type as defined in PKCS #8.

Its ASN.1 definition is as follows:

EncryptedPrivateKeyInfo ::= SEQUENCE { encryptionAlgorithm AlgorithmIdentifier, encryptedData OCTET STRING }

AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }

Since:

1.4

See Also:

PKCS8EncodedKeySpec

Constructors

Constructor Description
EncryptedPrivateKeyInfo​(byte[] encoded) Constructs (i.e., parses) an EncryptedPrivateKeyInfo from its ASN.1 encoding.
EncryptedPrivateKeyInfo​(String algName, byte[] encryptedData) Constructs an EncryptedPrivateKeyInfo from the encryption algorithm name and the encrypted data.
EncryptedPrivateKeyInfo​(AlgorithmParameters algParams, byte[] encryptedData) Constructs an EncryptedPrivateKeyInfo from the encryption algorithm parameters and the encrypted data.
Modifier and Type Method Description
String getAlgName() Returns the encryption algorithm.
AlgorithmParameters getAlgParameters() Returns the algorithm parameters used by the encryption algorithm.
byte[] getEncoded() Returns the ASN.1 encoding of this object.
byte[] getEncryptedData() Returns the encrypted data.
PKCS8EncodedKeySpec getKeySpec​(Key decryptKey) Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
PKCS8EncodedKeySpec getKeySpec​(Key decryptKey,String providerName) Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
PKCS8EncodedKeySpec getKeySpec​(Key decryptKey,Provider provider) Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.
PKCS8EncodedKeySpec getKeySpec​(Cipher cipher) Extract the enclosed PKCS8EncodedKeySpec object from the encrypted data and return it.

Methods declared in class java.lang.Object

[clone](../../java/lang/Object.html#clone%28%29), [equals](../../java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../java/lang/Object.html#finalize%28%29), [getClass](../../java/lang/Object.html#getClass%28%29), [hashCode](../../java/lang/Object.html#hashCode%28%29), [notify](../../java/lang/Object.html#notify%28%29), [notifyAll](../../java/lang/Object.html#notifyAll%28%29), [toString](../../java/lang/Object.html#toString%28%29), [wait](../../java/lang/Object.html#wait%28%29), [wait](../../java/lang/Object.html#wait%28long%29), [wait](../../java/lang/Object.html#wait%28long,int%29)