| java.lang.Object javax.crypto.Cipher
Cipher | public class Cipher (Code) | | version: $Revision: 1.1 $ author: Jeroen C. van Gelderen (gelderen@cryptix.org) author: Paul Waserbrot (pw@cryptix.org) |
Constructor Summary | |
protected | Cipher(CipherSpi cipherSpi, Provider provider, String transformation) Constructs a Cipher wrapping the given cipherSpi. |
Method Summary | |
final public byte[] | doFinal() | final public int | doFinal(byte[] output, int outputOffset) | final public byte[] | doFinal(byte[] input) | final public byte[] | doFinal(byte[] input, int inputOffset, int inputLen) | final public int | doFinal(byte[] input, int inputOffset, int inputLen, byte[] output) | final public int | doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) | final public String | getAlgorithm() Returns the name of the transformation implemented by this Cipher. | final public int | getBlockSize() Returns the block size if this Cipher, or 0 if the underlying
Cipher doesn't (yet) have a block size. | final public ExemptionMechanism | getExemptionMechanism() | final public byte[] | getIV() Returns the IV associated with this Cipher, or null if this Cipher
doesn't (yet) have one. | public static Cipher | getInstance(String transformation) Creates a Cipher that implements the given transformation. | public static Cipher | getInstance(String transformation, String provider) Creates a Cipher that implements the given transformation. | final public int | getOutputSize(int inputLen) Returns the maximum number of bytes that the next update() or
doFinal() operation can return, given the length of the input. | final public AlgorithmParameters | getParameters() | final public Provider | getProvider() Returns this Cipher's Provider. | final public void | init(int opmode, Key key) | final public void | init(int opmode, Key key, SecureRandom random) | final public void | init(int opmode, Key key, AlgorithmParameterSpec params) | final public void | init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) | final public void | init(int opmode, Key key, AlgorithmParameters params) | final public void | init(int opmode, Key key, AlgorithmParameters params, SecureRandom random) | final public void | init(int opmode, Certificate certificate) | final public void | init(int opmode, Certificate certificate, SecureRandom random) | public String | toString() | final public Key | unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) | final public byte[] | update(byte[] input) | final public byte[] | update(byte[] input, int inputOffset, int inputLen) | final public int | update(byte[] input, int inputOffset, int inputLen, byte[] output) | final public int | update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) | final public byte[] | wrap(java.security.Key key) |
ENCRYPT_MODEDECRYPT_MODEPRIVATE_KEYPUBLIC_KEYSECRET_KEYUNWRAP_MODEWRAP_MODE | final public static int ENCRYPT_MODEDECRYPT_MODEPRIVATE_KEYPUBLIC_KEYSECRET_KEYUNWRAP_MODEWRAP_MODE(Code) | | Constants used for the init() methods
|
Cipher | protected Cipher(CipherSpi cipherSpi, Provider provider, String transformation)(Code) | | Constructs a Cipher wrapping the given cipherSpi.
This method should be private, but is not for backward compatibility.
|
doFinal | final public int doFinal(byte[] output, int outputOffset) throws IllegalStateException, IllegalBlockSizeException, ShortBufferException, BadPaddingException(Code) | | |
doFinal | final public byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalStateException, IllegalBlockSizeException, BadPaddingException(Code) | | |
doFinal | final public int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output) throws IllegalStateException, ShortBufferException, IllegalBlockSizeException, BadPaddingException(Code) | | |
doFinal | final public int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalStateException, ShortBufferException, IllegalBlockSizeException, BadPaddingException(Code) | | |
getAlgorithm | final public String getAlgorithm()(Code) | | Returns the name of the transformation implemented by this Cipher.
|
getBlockSize | final public int getBlockSize()(Code) | | Returns the block size if this Cipher, or 0 if the underlying
Cipher doesn't (yet) have a block size.
|
getExemptionMechanism | final public ExemptionMechanism getExemptionMechanism()(Code) | | |
getIV | final public byte[] getIV()(Code) | | Returns the IV associated with this Cipher, or null if this Cipher
doesn't (yet) have one.
This is a rather brain damaged convenience method, because there is
no corresponding setIV method (you need to use the ParameterSpec crap
instead).
|
getInstance | public static Cipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException(Code) | | Creates a Cipher that implements the given transformation.
This call will search all installed Providers in preference order and
returns the first matching transformation.
Transformation is specified as the triple "Algorithm/Mode/Padding".
We currently do not support transformation of type "Algorithm" with
defaults for mode and padding.
Parameters: transformation - The requested transformation. throws: NoSuchAlgorithmException - If the given Algorithm/Mode/ combination cannot be found. throws: NoSuchPaddingException - If the given //Padding cannot be found. |
getInstance | public static Cipher getInstance(String transformation, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException(Code) | | Creates a Cipher that implements the given transformation.
This call searches the given provider only.
Transformation is specified as the triple "Algorithm/Mode/Padding".
We currently do not support transformation of type "Algorithm" with
defaults for mode and padding.
Parameters: transformation - The requested transformation. throws: NoSuchAlgorithmException - If the given Algorithm/Mode/ combination cannot be found. throws: NoSuchPaddingException - If the given //Padding cannot be found. throws: NoSuchProviderException - If the given provider is not installed. |
getOutputSize | final public int getOutputSize(int inputLen) throws IllegalStateException(Code) | | Returns the maximum number of bytes that the next update() or
doFinal() operation can return, given the length of the input.
This basically returns the sum of buffered data, padding, and input.
|
getProvider | final public Provider getProvider()(Code) | | Returns this Cipher's Provider.
|
update | final public int update(byte[] input, int inputOffset, int inputLen, byte[] output) throws IllegalStateException, ShortBufferException(Code) | | |
update | final public int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws IllegalStateException, ShortBufferException(Code) | | |
|
|