EncryptedPrivateKeyInfo (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.asn1.pkcs

## Class EncryptedPrivateKeyInfo

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo

- All Implemented Interfaces:
    ASN1Encodable, Encodable

      public class EncryptedPrivateKeyInfo
      extends ASN1Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EncryptedPrivateKeyInfo(AlgorithmIdentifier algId, byte[] encoding)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getEncryptedData()`
    `AlgorithmIdentifier` | `getEncryptionAlgorithm()`
    `static EncryptedPrivateKeyInfo` | `getInstance(java.lang.Object obj)`
    `ASN1Primitive` | `toASN1Primitive()` Produce an object suitable for an ASN1OutputStream.

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Object

      `encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EncryptedPrivateKeyInfo

          public EncryptedPrivateKeyInfo(AlgorithmIdentifier algId,
                                         byte[] encoding)

  - ### Method Detail

    - #### getInstance

          public static EncryptedPrivateKeyInfo getInstance(java.lang.Object obj)

    - #### getEncryptionAlgorithm

          public AlgorithmIdentifier getEncryptionAlgorithm()

    - #### getEncryptedData

          public byte[] getEncryptedData()

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

      Produce an object suitable for an ASN1OutputStream.

           EncryptedPrivateKeyInfo ::= SEQUENCE {
                encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
                encryptedData EncryptedData
           }

           EncryptedData ::= OCTET STRING

           KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
                    ... -- For local profiles
           }

      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a primitive representation of this object.