Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng.dbcrypt

# Interface DbCryptCallbackSpi

All Known Implementing Classes:
  `StaticValueDbCryptCallbackSpi`

public interface DbCryptCallbackSpi
Service provider interface for database encryption callback plugins.

NOTE: This plugin is currently only internal to Jaybird, consider the API as unstable.

Since:
  3.0.4
Author:
  Mark Rotteveel

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DbCryptCallback`
  `createDbCryptCallback(String dbCryptConfig)`
  Creates the database encryption callback with a configuration string.
  `String`
  `getDbCryptCallbackName()`
  Name of the database encryption callback.

- ## Method Details

  - ### getDbCryptCallbackName

    String getDbCryptCallbackName()
    Name of the database encryption callback.

    This name is for identification and selection purposes. As the name will be used in connection properties, we suggest to use relatively simple/short names, but make sure it is unique enough to prevent name conflicts. Consider using something like `<company-or-author>.<name>`.

    Returns:
      Name for identifying this callback within Jaybird.

  - ### createDbCryptCallback

    DbCryptCallback createDbCryptCallback(String dbCryptConfig)
    Creates the database encryption callback with a configuration string.

    The configuration string of the `dbCryptConfig` connection property is plugin specific, but we suggest the following conventions:

    - For binary data, use prefix `base64:` to indicate the rest of the string is base64-encoded
    - Avoid use of `&`, `;` or `:`, or 'hide' this by using base64 encoding; this is necessary to avoid existing limitations in the parsing of connection properties that are added directly to the URL (we hope to address this in the future), and to allow support for other prefixes similar to `base64:`
    Parameters:
      `dbCryptConfig` - Configuration string from connection properties, or `null` if absent
    Returns:
      Database encryption callback