Interface Encryption<P,C>

Type Parameters:
P - plaintext type.
C - ciphertext type.
All Known Implementing Classes:
MongoClientEncryption

public interface Encryption<P,C>
Component responsible for encrypting and decrypting values.
Since:
4.1
Author:
Christoph Strobl, Ross Lawley
  • Method Details

    • encrypt

      C encrypt(P value, EncryptionOptions options)
      Encrypt the given value.
      Parameters:
      value - must not be null.
      options - must not be null.
      Returns:
      the encrypted value.
    • decrypt

      P decrypt(C value)
      Decrypt the given value.
      Parameters:
      value - must not be null.
      Returns:
      the decrypted value.
    • encryptExpression

      default BsonDocument encryptExpression(BsonDocument value, EncryptionOptions options)
      Encrypt the given expression.
      Parameters:
      value - must not be null.
      options - must not be null.
      Returns:
      the encrypted expression.
      Since:
      4.5.0