Build 1.0_r1(from source)

javax.crypto
Class Cipher

java.lang.Object
  extended by javax.crypto.Cipher
Direct Known Subclasses:
NullCipher

public class Cipher
extends Object


Field Summary
static int DECRYPT_MODE
           
static int ENCRYPT_MODE
           
static int PRIVATE_KEY
           
static int PUBLIC_KEY
           
static int SECRET_KEY
           
static int UNWRAP_MODE
           
static int WRAP_MODE
           
 
Constructor Summary
protected Cipher(CipherSpi cipherSpi, Provider provider, String transformation)
           
 
Method Summary
 byte[] doFinal()
           
 byte[] doFinal(byte[] input)
           
 int doFinal(byte[] output, int outputOffset)
           
 byte[] doFinal(byte[] input, int inputOffset, int inputLen)
           
 int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output)
           
 int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
           
 int doFinal(ByteBuffer input, ByteBuffer output)
           
 String getAlgorithm()
           
 int getBlockSize()
           
 ExemptionMechanism getExemptionMechanism()
           
static Cipher getInstance(String transformation)
           
static Cipher getInstance(String transformation, Provider provider)
           
static Cipher getInstance(String transformation, String provider)
           
 byte[] getIV()
           
static int getMaxAllowedKeyLength(String transformation)
           
static AlgorithmParameterSpec getMaxAllowedParameterSpec(String transformation)
           
 int getOutputSize(int inputLen)
           
 AlgorithmParameters getParameters()
           
 Provider getProvider()
           
 void init(int opmode, Certificate certificate)
           
 void init(int opmode, Certificate certificate, SecureRandom random)
           
 void init(int opmode, Key key)
           
 void init(int opmode, Key key, AlgorithmParameters params)
           
 void init(int opmode, Key key, AlgorithmParameterSpec params)
           
 void init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
           
 void init(int opmode, Key key, AlgorithmParameters params, SecureRandom random)
           
 void init(int opmode, Key key, SecureRandom random)
           
 Key unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
           
 byte[] update(byte[] input)
           
 byte[] update(byte[] input, int inputOffset, int inputLen)
           
 int update(byte[] input, int inputOffset, int inputLen, byte[] output)
           
 int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
           
 int update(ByteBuffer input, ByteBuffer output)
           
 byte[] wrap(Key key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DECRYPT_MODE

public static final int DECRYPT_MODE
See Also:
Constant Field Values

ENCRYPT_MODE

public static final int ENCRYPT_MODE
See Also:
Constant Field Values

PRIVATE_KEY

public static final int PRIVATE_KEY
See Also:
Constant Field Values

PUBLIC_KEY

public static final int PUBLIC_KEY
See Also:
Constant Field Values

SECRET_KEY

public static final int SECRET_KEY
See Also:
Constant Field Values

UNWRAP_MODE

public static final int UNWRAP_MODE
See Also:
Constant Field Values

WRAP_MODE

public static final int WRAP_MODE
See Also:
Constant Field Values
Constructor Detail

Cipher

protected Cipher(CipherSpi cipherSpi,
                 Provider provider,
                 String transformation)
Method Detail

getInstance

public static final Cipher getInstance(String transformation)
                                throws NoSuchAlgorithmException,
                                       NoSuchPaddingException
Throws:
NoSuchAlgorithmException
NoSuchPaddingException

getInstance

public static final Cipher getInstance(String transformation,
                                       String provider)
                                throws NoSuchAlgorithmException,
                                       NoSuchProviderException,
                                       NoSuchPaddingException
Throws:
NoSuchAlgorithmException
NoSuchProviderException
NoSuchPaddingException

getInstance

public static final Cipher getInstance(String transformation,
                                       Provider provider)
                                throws NoSuchAlgorithmException,
                                       NoSuchPaddingException
Throws:
NoSuchAlgorithmException
NoSuchPaddingException

getProvider

public final Provider getProvider()

getAlgorithm

public final String getAlgorithm()

getBlockSize

public final int getBlockSize()

getOutputSize

public final int getOutputSize(int inputLen)

getIV

public final byte[] getIV()

getParameters

public final AlgorithmParameters getParameters()

getExemptionMechanism

public final ExemptionMechanism getExemptionMechanism()

init

public final void init(int opmode,
                       Key key)
                throws InvalidKeyException
Throws:
InvalidKeyException

init

public final void init(int opmode,
                       Key key,
                       SecureRandom random)
                throws InvalidKeyException
Throws:
InvalidKeyException

init

public final void init(int opmode,
                       Key key,
                       AlgorithmParameterSpec params)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

init

public final void init(int opmode,
                       Key key,
                       AlgorithmParameterSpec params,
                       SecureRandom random)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

init

public final void init(int opmode,
                       Key key,
                       AlgorithmParameters params)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

init

public final void init(int opmode,
                       Key key,
                       AlgorithmParameters params,
                       SecureRandom random)
                throws InvalidKeyException,
                       InvalidAlgorithmParameterException
Throws:
InvalidKeyException
InvalidAlgorithmParameterException

init

public final void init(int opmode,
                       Certificate certificate)
                throws InvalidKeyException
Throws:
InvalidKeyException

init

public final void init(int opmode,
                       Certificate certificate,
                       SecureRandom random)
                throws InvalidKeyException
Throws:
InvalidKeyException

update

public final byte[] update(byte[] input)

update

public final byte[] update(byte[] input,
                           int inputOffset,
                           int inputLen)

update

public final int update(byte[] input,
                        int inputOffset,
                        int inputLen,
                        byte[] output)
                 throws ShortBufferException
Throws:
ShortBufferException

update

public final int update(byte[] input,
                        int inputOffset,
                        int inputLen,
                        byte[] output,
                        int outputOffset)
                 throws ShortBufferException
Throws:
ShortBufferException

update

public final int update(ByteBuffer input,
                        ByteBuffer output)
                 throws ShortBufferException
Throws:
ShortBufferException

doFinal

public final byte[] doFinal()
                     throws IllegalBlockSizeException,
                            BadPaddingException
Throws:
IllegalBlockSizeException
BadPaddingException

doFinal

public final int doFinal(byte[] output,
                         int outputOffset)
                  throws IllegalBlockSizeException,
                         ShortBufferException,
                         BadPaddingException
Throws:
IllegalBlockSizeException
ShortBufferException
BadPaddingException

doFinal

public final byte[] doFinal(byte[] input)
                     throws IllegalBlockSizeException,
                            BadPaddingException
Throws:
IllegalBlockSizeException
BadPaddingException

doFinal

public final byte[] doFinal(byte[] input,
                            int inputOffset,
                            int inputLen)
                     throws IllegalBlockSizeException,
                            BadPaddingException
Throws:
IllegalBlockSizeException
BadPaddingException

doFinal

public final int doFinal(byte[] input,
                         int inputOffset,
                         int inputLen,
                         byte[] output)
                  throws ShortBufferException,
                         IllegalBlockSizeException,
                         BadPaddingException
Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException

doFinal

public final int doFinal(byte[] input,
                         int inputOffset,
                         int inputLen,
                         byte[] output,
                         int outputOffset)
                  throws ShortBufferException,
                         IllegalBlockSizeException,
                         BadPaddingException
Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException

doFinal

public final int doFinal(ByteBuffer input,
                         ByteBuffer output)
                  throws ShortBufferException,
                         IllegalBlockSizeException,
                         BadPaddingException
Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException

wrap

public final byte[] wrap(Key key)
                  throws IllegalBlockSizeException,
                         InvalidKeyException
Throws:
IllegalBlockSizeException
InvalidKeyException

unwrap

public final Key unwrap(byte[] wrappedKey,
                        String wrappedKeyAlgorithm,
                        int wrappedKeyType)
                 throws InvalidKeyException,
                        NoSuchAlgorithmException
Throws:
InvalidKeyException
NoSuchAlgorithmException

getMaxAllowedKeyLength

public static final int getMaxAllowedKeyLength(String transformation)
                                        throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

getMaxAllowedParameterSpec

public static final AlgorithmParameterSpec getMaxAllowedParameterSpec(String transformation)
                                                               throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

Build 1.0_r1(from source)

Please submit a feedback, bug or feature