Class EncryptOptions

java.lang.Object
com.mongodb.client.model.vault.EncryptOptions

public class EncryptOptions extends Object
The options for explicit encryption.
Since:
3.11
  • Constructor Details

    • EncryptOptions

      public EncryptOptions(String algorithm)
      Construct an instance with the given algorithm.
      Parameters:
      algorithm - the encryption algorithm
      See Also:
  • Method Details

    • getAlgorithm

      public String getAlgorithm()
      Gets the encryption algorithm, which must be either "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" or "AEAD_AES_256_CBC_HMAC_SHA_512-Random".
      Returns:
      the encryption algorithm
    • getKeyId

      @Nullable public BsonBinary getKeyId()
      Gets the key identifier.

      Identifies the data key by its _id value. The value is a UUID (binary subtype 4).

      Returns:
      the key identifier
    • getKeyAltName

      @Nullable public String getKeyAltName()
      Gets the alternate name with which to look up the key.

      Identifies the alternate key name to look up the key by.

      Returns:
      the alternate name
    • keyId

      public EncryptOptions keyId(BsonBinary keyId)
      Sets the key identifier
      Parameters:
      keyId - the key identifier
      Returns:
      this
      See Also:
    • keyAltName

      public EncryptOptions keyAltName(String keyAltName)
      Sets the alternate key name
      Parameters:
      keyAltName - the alternate key name
      Returns:
      this
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object