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

org.bouncycastle.crypto

## Class Commitment

- java.lang.Object
- - org.bouncycastle.crypto.Commitment

-     public class Commitment
      extends java.lang.Object

  General holding class for a commitment.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Commitment(byte[] secret, byte[] commitment)` Base constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getCommitment()` The sealed commitment.
    `byte[]` | `getSecret()` The secret required to reveal the commitment.

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

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

- - ### Constructor Detail

    - #### Commitment

          public Commitment(byte[] secret,
                            byte[] commitment)

      Base constructor.
      Parameters:
        `secret` - an encoding of the secret required to reveal the commitment.
        `commitment` - an encoding of the sealed commitment.

  - ### Method Detail

    - #### getSecret

          public byte[] getSecret()

      The secret required to reveal the commitment.
      Returns:
        an encoding of the secret associated with the commitment.

    - #### getCommitment

          public byte[] getCommitment()

      The sealed commitment.
      Returns:
        an encoding of the sealed commitment.