Module java.base
Package javax.crypto

# Class Cipher

=
public class Cipher
extends java.lang.Object

## Fields

- =
  public static final int DECRYPT_MODE = 2
- =
  public static final int ENCRYPT_MODE = 1
- =
  public static final int PRIVATE_KEY = 2
- =
  public static final int PUBLIC_KEY = 1
- =
  public static final int SECRET_KEY = 3
- =
  public static final int UNWRAP_MODE = 4
- =
  public static final int WRAP_MODE = 3

## Constructors

- =
  protected Cipher(javax.crypto.CipherSpi arg0, java.security.Provider arg1, java.lang.String arg2)

## Methods

- =
  public final byte[] doFinal() throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException
- =
  public final byte[] doFinal(byte[] arg0) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException
- =
  public final int doFinal(byte[] arg0, int arg1) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException
- =
  public final byte[] doFinal(byte[] arg0, int arg1, int arg2) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException
- =
  public final int doFinal(byte[] arg0, int arg1, int arg2, byte[] arg3) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException
- =
  public final int doFinal(byte[] arg0, int arg1, int arg2, byte[] arg3, int arg4) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException
- =
  public final int doFinal(java.nio.ByteBuffer arg0, java.nio.ByteBuffer arg1) throws javax.crypto.BadPaddingException, javax.crypto.IllegalBlockSizeException, javax.crypto.ShortBufferException
- =
  public final java.lang.String getAlgorithm()
- =
  public final int getBlockSize()
- =
  public final javax.crypto.ExemptionMechanism getExemptionMechanism()
- =
  public final byte[] getIV()
- =
  public static final javax.crypto.Cipher getInstance(java.lang.String arg0) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException
- =
  public static final javax.crypto.Cipher getInstance(java.lang.String arg0, java.lang.String arg1) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, javax.crypto.NoSuchPaddingException
- =
  public static final javax.crypto.Cipher getInstance(java.lang.String arg0, java.security.Provider arg1) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException
- =
  public static final int getMaxAllowedKeyLength(java.lang.String arg0) throws java.security.NoSuchAlgorithmException
- =
  public static final java.security.spec.AlgorithmParameterSpec getMaxAllowedParameterSpec(java.lang.String arg0) throws java.security.NoSuchAlgorithmException
- =
  public final int getOutputSize(int arg0)
- =
  public final java.security.AlgorithmParameters getParameters()
- =
  public final java.security.Provider getProvider()
- =
  public final void init(int arg0, java.security.Key arg1) throws java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.Key arg1, java.security.AlgorithmParameters arg2) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.Key arg1, java.security.AlgorithmParameters arg2, java.security.SecureRandom arg3) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.Key arg1, java.security.SecureRandom arg2) throws java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.Key arg1, java.security.spec.AlgorithmParameterSpec arg2) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.Key arg1, java.security.spec.AlgorithmParameterSpec arg2, java.security.SecureRandom arg3) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.cert.Certificate arg1) throws java.security.InvalidKeyException
- =
  public final void init(int arg0, java.security.cert.Certificate arg1, java.security.SecureRandom arg2) throws java.security.InvalidKeyException
- =
  public java.lang.String toString()
- =
  public final java.security.Key unwrap(byte[] arg0, java.lang.String arg1, int arg2) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException
- =
  public final byte[] update(byte[] arg0)
- =
  public final byte[] update(byte[] arg0, int arg1, int arg2)
- =
  public final int update(byte[] arg0, int arg1, int arg2, byte[] arg3) throws javax.crypto.ShortBufferException
- =
  public final int update(byte[] arg0, int arg1, int arg2, byte[] arg3, int arg4) throws javax.crypto.ShortBufferException
- =
  public final int update(java.nio.ByteBuffer arg0, java.nio.ByteBuffer arg1) throws javax.crypto.ShortBufferException
- =
  public final void updateAAD(byte[] arg0)
- =
  public final void updateAAD(byte[] arg0, int arg1, int arg2)
- =
  public final void updateAAD(java.nio.ByteBuffer arg0)
- =
  public final byte[] wrap(java.security.Key arg0) throws java.security.InvalidKeyException, javax.crypto.IllegalBlockSizeException

## Summary

No differences.