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

org.bouncycastle.asn1.crmf

## Class EncryptedValue

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.crmf.EncryptedValue

- All Implemented Interfaces:
    ASN1Encodable, Encodable

      public class EncryptedValue
      extends ASN1Object

  EncryptedValue Please see reference to pending deprecation in favour of EnvelopedData. Abstract of:

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EncryptedValue(AlgorithmIdentifier intendedAlg, AlgorithmIdentifier symmAlg, ASN1BitString encSymmKey, AlgorithmIdentifier keyAlg, ASN1OctetString valueHint, ASN1BitString encValue)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ASN1BitString` | `getEncSymmKey()`
    `ASN1BitString` | `getEncValue()`
    `static EncryptedValue` | `getInstance(java.lang.Object o)`
    `AlgorithmIdentifier` | `getIntendedAlg()`
    `AlgorithmIdentifier` | `getKeyAlg()`
    `AlgorithmIdentifier` | `getSymmAlg()`
    `ASN1OctetString` | `getValueHint()`
    `ASN1Primitive` | `toASN1Primitive()` (IMPLICIT TAGS) EncryptedValue ::= SEQUENCE { intendedAlg [0] AlgorithmIdentifier OPTIONAL, -- the intended algorithm for which the value will be used symmAlg [1] AlgorithmIdentifier OPTIONAL, -- the symmetric algorithm used to encrypt the value encSymmKey [2] BIT STRING OPTIONAL, -- the (encrypted) symmetric key used to encrypt the value keyAlg [3] AlgorithmIdentifier OPTIONAL, -- algorithm used to encrypt the symmetric key valueHint [4] OCTET STRING OPTIONAL, -- a brief description or identifier of the encValue content -- (may be meaningful only to the sending entity, and used only -- if EncryptedValue might be re-examined by the sending entity -- in the future) encValue BIT STRING } -- the encrypted value itself

    - ### 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

    - #### EncryptedValue

          public EncryptedValue(AlgorithmIdentifier intendedAlg,
                                AlgorithmIdentifier symmAlg,
                                ASN1BitString encSymmKey,
                                AlgorithmIdentifier keyAlg,
                                ASN1OctetString valueHint,
                                ASN1BitString encValue)

  - ### Method Detail

    - #### getInstance

          public static EncryptedValue getInstance(java.lang.Object o)

    - #### getIntendedAlg

          public AlgorithmIdentifier getIntendedAlg()

    - #### getSymmAlg

          public AlgorithmIdentifier getSymmAlg()

    - #### getEncSymmKey

          public ASN1BitString getEncSymmKey()

    - #### getKeyAlg

          public AlgorithmIdentifier getKeyAlg()

    - #### getValueHint

          public ASN1OctetString getValueHint()

    - #### getEncValue

          public ASN1BitString getEncValue()

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

           (IMPLICIT TAGS)
           EncryptedValue ::= SEQUENCE {
                               intendedAlg   [0] AlgorithmIdentifier  OPTIONAL,
                               -- the intended algorithm for which the value will be used
                               symmAlg       [1] AlgorithmIdentifier  OPTIONAL,
                               -- the symmetric algorithm used to encrypt the value
                               encSymmKey    [2] BIT STRING           OPTIONAL,
                               -- the (encrypted) symmetric key used to encrypt the value
                               keyAlg        [3] AlgorithmIdentifier  OPTIONAL,
                               -- algorithm used to encrypt the symmetric key
                               valueHint     [4] OCTET STRING         OPTIONAL,
                               -- a brief description or identifier of the encValue content
                               -- (may be meaningful only to the sending entity, and used only
                               -- if EncryptedValue might be re-examined by the sending entity
                               -- in the future)
                               encValue       BIT STRING }
                               -- the encrypted value itself

      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a basic ASN.1 object representation.