Name

Class javax.crypto.CipherSpi

Description

The CipherSpi class is the parent class of all cipher implementations. To implement a particular cipher algorithm, create a subclass of CipherSpi and define all its methods. Most of the methods correspond to methods in Cipher’s API; for example, a call to Cipher’s getBlockSize() method results in a call to the implementation’s engineGetBlockSize().

Class Definition

public abstract class javax.crypto.CipherSpi
  extends java.lang.Object {

  // Constructors
  public CipherSpi();

  // Protected Instance Methods
  protected abstract byte[] engineDoFinal(byte[], int, int);
  protected abstract int engineDoFinal(byte[], int, int, byte[], int);
  protected abstract int engineGetBlockSize();
  protected abstract byte[] engineGetIV();
  protected abstract int engineGetOutputSize(int);
  protected abstract void engineInit(int, Key, SecureRandom);
  protected abstract void engineInit(int, Key, AlgorithmParameterSpec,
    SecureRandom);
  protected abstract void engineSetMode(String);
  protected abstract void engineSetPadding(String);
  protected abstract byte[] engineUpdate(byte[], int, int);
  protected abstract int engineUpdate(byte[], int, int, byte[], int);
}

See Also

AlgorithmParameterSpec, Cipher, Key, SecureRandom

Get Java Cryptography now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.