|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.crypto.CipherSpi de.cscc.crypto.provider.DESBaseCipherEngine de.cscc.crypto.provider.DESede3KeyCipherEngine
This is the concret DESede3Key algorithm class, it subclasses DESBaseCipherEngine, because in JCE is no possiblity to set a cipher.
Constructor Summary | |
DESede3KeyCipherEngine()
Creates a new DESede3KeyCipherEngine object. |
Method Summary | |
protected byte[] |
engineDoFinal(byte[] input,
int inputOffset,
int inputLen)
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
protected int |
engineDoFinal(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset)
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
protected int |
engineGetBlockSize()
Returns the block size (in bytes). |
protected byte[] |
engineGetIV()
Returns the initialization vector (IV) in a new buffer. |
protected int |
engineGetKeySize(Key key)
Returns the key size of the given key object. |
protected int |
engineGetOutputSize(int inputLen)
Returns the length in bytes that an output buffer would need to be in order to hold the result of the next update or doFinal operation, given the input length inputLen (in bytes). |
protected AlgorithmParameters |
engineGetParameters()
Returns the parameters used with this cipher. |
protected void |
engineInit(int opmode,
Key key,
AlgorithmParameterSpec params,
SecureRandom random)
Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. |
protected void |
engineInit(int opmode,
Key key,
AlgorithmParameters params,
SecureRandom random)
Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. |
protected void |
engineInit(int opmode,
Key key,
SecureRandom random)
Initializes this cipher with a key and a source of randomness. |
protected void |
engineSetMode(String mode)
Sets the mode of this cipher. |
protected void |
engineSetPadding(String padding)
Sets the padding mechanism of this cipher. |
protected Key |
engineUnwrap(byte[] wrappedKey,
String wrappedKeyAlgorithm,
int wrappedKeyType)
Unwrap a previously wrapped key. |
protected byte[] |
engineUpdate(byte[] input,
int inputOffset,
int inputLen)
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
protected int |
engineUpdate(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset)
Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
protected byte[] |
engineWrap(Key key)
Wrap a key. |
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DESede3KeyCipherEngine()
Method Detail |
public String toString()
protected void engineSetMode(String mode) throws NoSuchAlgorithmException
mode
- the cipher mode.
NoSuchAlgorithmException
- if the requested cipher mode does not exist.protected void engineSetPadding(String padding) throws NoSuchPaddingException
padding
- the padding mechanism.
NoSuchPaddingException
- if the requested padding mechanism does not exist.protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException
opmode
- the operation mode of this cipher.
This is one of the following:
javax.crypto.Cipher.ENCRYPT_MODE
javax.crypto.Cipher.DECRYPT_MODE
javax.crypto.Cipher.WRAP_MODE
javax.crypto.Cipher.UNWRAP_MODEkey
- the key to encrypt or to decrypt.random
- the source of randomness.
InvalidKeyException
- if the given key is inappropriate for initializing
this cipher, or if this cipher is being initialized
for decryption and requires algorithm parameters
that cannot be determinated from the given key.protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException
opmode
- the operation mode of this cipher.
This is one of the following:
javax.crypto.Cipher.ENCRYPT_MODE
javax.crypto.Cipher.DECRYPT_MODE
javax.crypto.Cipher.WRAP_MODE
javax.crypto.Cipher.UNWRAP_MODEkey
- the key to encrypt or to decrypt.params
- the algorithm paramter.random
- the source of randomness.
InvalidKeyException
- if the given key is inappropriate for initializing
this cipher.
InvalidAlgorithmParameterException
- if the given algorithm parameters are inappropriate
for this cipher, or if this cipher is being
initialized for decryption and requires algorithm
parameters and params is null.protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException
opmode
- the operation mode of this cipher.
This is one of the following:
javax.crypto.Cipher.ENCRYPT_MODE
javax.crypto.Cipher.DECRYPT_MODE
javax.crypto.Cipher.WRAP_MODE
javax.crypto.Cipher.UNWRAP_MODEkey
- the key to encrypt or to decrypt.params
- the algorithm paramter.random
- the source of randomness.
InvalidKeyException
- if the given key is inappropriate for initializing
this cipher.
InvalidAlgorithmParameterException
- if the given algorithm parameters are inappropriate
for this cipher, or if this cipher is being
initialized for decryption and requires algorithm
parameters and params is null.protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen)
input
- the input buffer.inputOffset
- the offset in input where the input starts.inputLen
- the input length.
protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException
input
- the input buffer.inputOffset
- the offset in input where the input starts.inputLen
- the input length.output
- the buffer for the result.outputOffset
- the offset in output where the result is stored.
ShortBufferException
- if the given output buffer is too small to
hold the result.protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException
input
- the input buffer.inputOffset
- the offset in input where the input starts.inputLen
- the input length.
IllegalBlockSizeException
- if this cipher is a block cipher, no padding
has been requested (only in encryption mode),
and the total input length of the data processed
by this cipher is not a multiple of block size.
BadPaddingException
- if this cipher is in decryption mode,
and (un)padding has been requested,
but the decrypted data is not bounded
by the appropriate padding bytes.protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException
input
- the input buffer.inputOffset
- the offset in input where the input starts.inputLen
- the input length.output
- the buffer for the finally result.outputOffset
- the offset in output where the result is stored.
ShortBufferException
- if the given output buffer is too small to
hold the result.
IllegalBlockSizeException
- if this cipher is a block cipher, no padding
has been requested (only in encryption mode),
and the total input length of the data processed
by this cipher is not a multiple of block size.
BadPaddingException
- if this cipher is in decryption mode,
and (un)padding has been requested,
but the decrypted data is not bounded
by the appropriate padding bytes.protected int engineGetOutputSize(int inputLen)
inputLen
- the input length in bytes.
protected AlgorithmParameters engineGetParameters()
protected byte[] engineGetIV()
protected int engineGetBlockSize()
protected int engineGetKeySize(Key key) throws InvalidKeyException
key
- the key object.
InvalidKeyException
- if key is invalid.protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException
wrappedKey
- the wrapped key to unwrap.wrappedKeyAlgorithm
- the algorithm associated with the key wrapped key.wrappedKeyType
- the type of the wrapped key. This is one of
javax.crypto.Cipher.SECRET_KEY,
javax.crypto.Cipher.PRIVATE_KEY,
javax.crypto.Cipher.PUBLIC_KEY.
InvalidKeyException
- if wrappedKey does not represent a wrapped key,
or if the algorithm associated with the wrapped
key is different from wrappedKeyAlgorithm and/or
its key type is different from wrappedKeyType.
NoSuchAlgorithmException
- if no installed providers can create
keys for the wrappedKeyAlgorithm.protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException
key
- the key to be wrapped.
IllegalBlockSizeException
- if this cipher is a block cipher,
no padding has been requested, and the
length of the encoding of the key to be
wrapped is not a multiple of the block size.
InvalidKeyException
- if it is impossible or unsafe to wrap the
key with this cipher (e.g., a hardware
public key is being passed to a
software-only cipher).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |