EncryptedValueBuilder (Bouncy Castle Library 1.52 API Specification)
Date: 2015-03-01

org.bouncycastle.cert.crmf

## Class EncryptedValueBuilder

- java.lang.Object
- - org.bouncycastle.cert.crmf.EncryptedValueBuilder

- Direct Known Subclasses:
    JcaEncryptedValueBuilder

      public class EncryptedValueBuilder
      extends java.lang.Object

  Builder for EncryptedValue structures.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EncryptedValueBuilder(KeyWrapper wrapper, OutputEncryptor encryptor)` Create a builder that makes EncryptedValue structures.
    `EncryptedValueBuilder(KeyWrapper wrapper, OutputEncryptor encryptor, EncryptedValuePadder padder)` Create a builder that makes EncryptedValue structures with fixed length blocks padded using the passed in padder.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.bouncycastle.asn1.crmf.EncryptedValue` | `build(char[] revocationPassphrase)` Build an EncryptedValue structure containing the passed in pass phrase.
    `org.bouncycastle.asn1.crmf.EncryptedValue` | `build(X509CertificateHolder holder)` Build an EncryptedValue structure containing the certificate contained in the passed in holder.

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

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

- - ### Constructor Detail

    - #### EncryptedValueBuilder

          public EncryptedValueBuilder(KeyWrapper wrapper,
                               OutputEncryptor encryptor)

      Create a builder that makes EncryptedValue structures.
      Parameters:
        `wrapper` - a wrapper for key used to encrypt the actual data contained in the EncryptedValue.
        `encryptor` - an output encryptor to encrypt the actual data contained in the EncryptedValue.

    - #### EncryptedValueBuilder

          public EncryptedValueBuilder(KeyWrapper wrapper,
                               OutputEncryptor encryptor,
                               EncryptedValuePadder padder)

      Create a builder that makes EncryptedValue structures with fixed length blocks padded using the passed in padder.
      Parameters:
        `wrapper` - a wrapper for key used to encrypt the actual data contained in the EncryptedValue.
        `encryptor` - an output encryptor to encrypt the actual data contained in the EncryptedValue.
        `padder` - a padder to ensure that the EncryptedValue created will always be a constant length.

  - ### Method Detail

    - #### build

          public org.bouncycastle.asn1.crmf.EncryptedValue build(char[] revocationPassphrase)
                                                          throws CRMFException

      Build an EncryptedValue structure containing the passed in pass phrase.
      Parameters:
        `revocationPassphrase` - a revocation pass phrase.
      Returns:
        an EncryptedValue containing the encrypted pass phrase.
      Throws:
        `CRMFException` - on a failure to encrypt the data, or wrap the symmetric key for this value.

    - #### build

          public org.bouncycastle.asn1.crmf.EncryptedValue build(X509CertificateHolder holder)
                                                          throws CRMFException

      Build an EncryptedValue structure containing the certificate contained in the passed in holder.
      Parameters:
        `holder` - a holder containing a certificate.
      Returns:
        an EncryptedValue containing the encrypted certificate.
      Throws:
        `CRMFException` - on a failure to encrypt the data, or wrap the symmetric key for this value.