001package io.ebean.config.dbplatform;
002
003/**
004 * Defines DB encryption support for encrypting and decrypting data using DB
005 * encryption features.
006 * <p>
007 * As an alternative to using DB encryption you can encrypt/decrypt in java via
008 * a special ScalarType but this has the limitation that you can't include that
009 * property in query where clauses.
010 */
011public interface DbEncrypt {
012
013  /**
014   * Return the DB encrypt function for the given JDBC type.
015   */
016  DbEncryptFunction getDbEncryptFunction(int jdbcType);
017
018  /**
019   * Return the DB type that encrypted Strings are stored in.
020   * <p>
021   * This is VARCHAR for MySql and VARBINARY for most others.
022   */
023  int getEncryptDbType();
024
025  /**
026   * Return true if the DB encrypt function binds the data before the key.
027   */
028  boolean isBindEncryptDataFirst();
029}