May 2001
Intermediate to advanced
618 pages
20h 50m
English
Class javax.crypto.Cipher
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.
public class javax.crypto.Cipher extends java.lang.Object { // Constants public static final int DECRYPT_MODE; public static final int ENCRYPT_MODE; public static final int PRIVATE_KEY; public static final int PUBLIC_KEY; public static final int SECRET_KEY; public static final int UNWRAP_MODE; public static final int WRAP_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 int doFinal(byte[], int, int, byte[]); public final int doFinal(byte[], int, int, byte[], int); public final byte[] doFinal(byte[]); public final byte[] doFinal(byte[], int, int); public final byte[] doFinal( ); public final int doFinal(byte[], int); public final String getAlgorithm( ); public final int getBlockSize( ); public final ExemptionMechanism getExemptionMechanism( ...Read now
Unlock full access