Name
Class javax.crypto.Cipher
Synopsis
This engine class represents a cryptographic cipher, either symmetric
or asymmetric. To get a cipher for a particular algorithm, call one
of the getInstance()
methods, specifying an
algorithm name, a cipher mode, and a padding scheme. The cipher
should be initialized for encryption or decryption using an
init()
method and an appropriate key (and,
optionally, a set of algorithm-specific parameters, though these are
typically unused). Then you can perform the encryption or decryption,
using the update()
and
doFinal()
methods.
Class Definition
public class javax.crypto.Cipher extends java.lang.Object { // Constants public static final int DECRYPT_MODE; public static final int ENCRYPT_MODE; // Constructors protected Cipher(CipherSpi, Provider, String); // Class Methods public static final Cipher getInstance(String); public static final Cipher getInstance(String, String); // Instance Methods public final byte[] doFinal(); public final byte[] doFinal(byte[]); public final int doFinal(byte[], int); public final byte[] doFinal(byte[], int, int); public final int doFinal(byte[], int, int, byte[]); public final int doFinal(byte[], int, int, byte[], int); public final int getBlockSize(); public final byte[] getIV(); public final int getOutputSize(int); public final AlgorithmParameters getParameters(); public final Provider getProvider(); public final void init(int, Key); public final void init(int, Key, SecureRandom); public final void init(int, Key, AlgorithmParameterSpec); ...
Get Java Security 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.