Skip to Content
Java Security
book

Java Security

by Scott Oaks
May 1998
Intermediate to advanced
469 pages
14h 57m
English
O'Reilly Media, Inc.
Content preview from Java Security

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); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Security Handbook

Java Security Handbook

Jamie Jaworski, Paul J. Perrone, Venkata S.R. Krishna Chaganti

Publisher Resources

ISBN: 1565924037Supplemental ContentCatalog PageErrata