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

# Interface DbCryptCallback

All Known Implementing Classes:
  `StaticValueDbCryptCallback`

public interface DbCryptCallback
Plugin for Firebird database encryption callback.

Database encryption callbacks are allowed to be stateful (eg if they require multiple callbacks to work). A new callback instance is created for each authentication phase of a connection (a connection can have multiple authentication phases).

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
`String`
`getDbCryptCallbackName()`
Name of the database encryption callback.
`DbCryptData`
`handleCallback(DbCryptData serverData)`
Callback method to be called with the server data.

## Method Details

### getDbCryptCallbackName

String getDbCryptCallbackName()
Name of the database encryption callback.

Returns:
  Name for identifying this callback within Jaybird.
See Also:
  - `DbCryptCallbackSpi.getDbCryptCallbackName()`

### handleCallback

DbCryptData handleCallback(DbCryptData serverData)
Callback method to be called with the server data.

The implementation should reply with a response for the provided data. If the plugin cannot provide a response (eg because the server data is invalid), use an empty reply (eg use `DbCryptData.EMPTY_DATA`, or construct your own). The plugin should not throw an exception.

Parameters:
  `serverData` - Data received from the server (never `null`).
Returns:
  Reply data (never `null`, use `DbCryptData.EMPTY_DATA` if there is no (valid) reply).