org.apache.ignite.spi.encryption

## Interface EncryptionSpi

All Superinterfaces:
  IgniteSpi

All Known Implementing Classes:
  KeystoreEncryptionSpi, NoopEncryptionSpi

    public interface EncryptionSpi
    extends IgniteSpi

SPI provides encryption features for an Ignite.

### Method Summary

All Methods Instance Methods Abstract Methods
`int` `blockSize()`
`Serializable` `create()` Creates new key for an encryption/decryption of cache persistent data: pages, WAL records.
`byte[]` `decrypt(byte[] data, Serializable key)` Decrypts data encrypted with `encrypt(ByteBuffer, Serializable, ByteBuffer)`
`Serializable` `decryptKey(byte[] key)` Decrypts key and checks it integrity.
`void` `decryptNoPadding(ByteBuffer data, Serializable key, ByteBuffer res)` Decrypts data encrypted with `encryptNoPadding(ByteBuffer, Serializable, ByteBuffer)`
`void` `encrypt(ByteBuffer data, Serializable key, ByteBuffer res)` Encrypts data.
`int` `encryptedSize(int dataSize)`
`int` `encryptedSizeNoPadding(int dataSize)`
`byte[]` `encryptKey(Serializable key)` Encrypts key.
`void` `encryptNoPadding(ByteBuffer data, Serializable key, ByteBuffer res)` Encrypts data without padding info.
`byte[]` `masterKeyDigest()` Returns master key digest.

### Methods inherited from interface org.apache.ignite.spi.IgniteSpi

`getName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitialized, spiStart, spiStop`

### Method Detail

#### masterKeyDigest

    byte[] masterKeyDigest()

Returns master key digest. Should always return same digest for a same key. Digest used for a configuration consistency check.

Returns:
  Master key digest.

#### create

    Serializable create()
                 throws IgniteException

Creates new key for an encryption/decryption of cache persistent data: pages, WAL records.

Returns:
  Newly created encryption key.
Throws:
  `IgniteException` - If key creation failed.

#### encrypt

    void encrypt(ByteBuffer data,
                 Serializable key,
                 ByteBuffer res)

Encrypts data.

Parameters:
  `data` - Data to encrypt.
  `key` - Encryption key.
  `res` - Destination buffer.

#### encryptNoPadding

    void encryptNoPadding(ByteBuffer data,
                          Serializable key,
                          ByteBuffer res)

Encrypts data without padding info.

Parameters:
  `data` - Data to encrypt.
  `key` - Encryption key.
  `res` - Destination buffer.

#### decrypt

    byte[] decrypt(byte[] data,
                   Serializable key)

Decrypts data encrypted with `encrypt(ByteBuffer, Serializable, ByteBuffer)`

Parameters:
  `data` - Data to decrypt.
  `key` - Encryption key.

#### decryptNoPadding

    void decryptNoPadding(ByteBuffer data,
                          Serializable key,
                          ByteBuffer res)

Decrypts data encrypted with `encryptNoPadding(ByteBuffer, Serializable, ByteBuffer)`

Parameters:
  `data` - Data to decrypt.
  `key` - Encryption key.

#### encryptKey

    byte[] encryptKey(Serializable key)

Encrypts key. Adds some info to check key integrity on decryption.

Parameters:
  `key` - Key to encrypt.
Returns:
  Encrypted key.

#### decryptKey

    Serializable decryptKey(byte[] key)

Decrypts key and checks it integrity.

Parameters:
  `key` - Key to decrypt.
Returns:
  Encrypted key.

#### encryptedSize

    int encryptedSize(int dataSize)

Parameters:
  `dataSize` - Size of plain data in bytes.
Returns:
  Size of encrypted data in bytes for padding encryption mode.

#### encryptedSizeNoPadding

    int encryptedSizeNoPadding(int dataSize)

Parameters:
  `dataSize` - Size of plain data in bytes.
Returns:
  Size of encrypted data in bytes for nopadding encryption mode.

#### blockSize

    int blockSize()

Returns:
  Encrypted data block size.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019