Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng.wire.crypt

# Interface EncryptionPluginSpi

All Known Implementing Classes:
  `Arc4EncryptionPluginSpi`, `ChaChaEncryptionPluginSpi`

public interface EncryptionPluginSpi
Service provider interface for wire encryption plugins.

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

Since:
  4.0
Author:
  Mark Rotteveel

- ## Method Summary

  Modifier and Type
  Method
  Description
  `EncryptionPlugin`
  `createEncryptionPlugin(CryptSessionConfig cryptSessionConfig)`
  Creates the encryption plugin for the provided crypt session config.
  `EncryptionIdentifier`
  `encryptionIdentifier()`
  `boolean`
  `isSupported(CryptConnectionInfo cryptConnectionInfo)`
  Reports if the encryption plugin can work.

- ## Method Details

  - ### encryptionIdentifier

    EncryptionIdentifier encryptionIdentifier()
    Returns:
      Encryption identifier

  - ### createEncryptionPlugin

    EncryptionPlugin createEncryptionPlugin(CryptSessionConfig cryptSessionConfig)
    Creates the encryption plugin for the provided crypt session config.
    Parameters:
      `cryptSessionConfig` - Crypt session config
    Returns:
      Encryption plugin

  - ### isSupported

    boolean isSupported(CryptConnectionInfo cryptConnectionInfo)
    Reports if the encryption plugin can work.

    The `connectionInfo` can be used to check compatibility with the connection, but other checks may be done as well. If the plugin expects to always work, it can simply return `true`.

    NOTE: Returning `true` does not express a guarantee the plugin will work, instead `false` expresses that the plugin cannot (or should not) be tried to use, because it will fail anyway.

    Parameters:
      `cryptConnectionInfo` - information on the connection
    Returns:
      `true` if the SPI expects the plugin to work, `false` if the plugin will not work
    Since:
      6