| Modifier and Type | Field and Description |
|---|---|
| public static final int | DECRYPT_MODE
Constant specifying decrypt mode. |
| public static final int | ENCRYPT_MODE
Constant specifying encrypt mode. |
| protected int | opMode
The operation mode for this cipher ( |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final byte[] | Returns: a new buffer with the resultFinish a multiple-part encryption or decryption operation (depending on how this cipher was initialized). |
| public final byte[] | Returns: a new buffer with the resultthe input buffer input)Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized). |
| public abstract byte[] | Returns: a new buffer with the resultthe input buffer input, int the offset where the input starts inOff, int the input length inLen)Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized). |
| public abstract int | Returns: the output lengththe input buffer input, int the offset where the input starts inOff, int the input length inLen, byte[] the buffer for the result output, int the offset where the result is stored outOff)Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized). |
| protected final byte[] | Returns: the byte array containing the en-/decrypted datathe byte array holding the data to be processed input, int the offset indicating the start position within the input
byte array inOff, int the number of bytes to be processed inLen)Implements abstract javax. |
| protected final int | Returns: the number of bytes stored in the output byte arraythe byte array holding the data to be processed input, int the offset indicating the start position within the input
byte array inOff, int the number of bytes to be processed inLen, byte[] the byte array for holding the result output, int the offset indicating the start position within the output
byte array to which the en/decrypted data is written outOff)Implements abstract javax. |
| protected final int | Returns: the block size (in bytes), or 0 if the underlying algorithm is not a block cipherImplements abstract javax. |
| protected final byte[] | Returns: the initialization vector in a new buffer, or null if the underlying algorithm does not use an IV, or if the IV has not yet been set.Implements abstract javax. |
| protected final int | Returns: the key size in bits of the given key objectthe key object key)Overrides javax. |
| protected final int | Returns: the required output buffer size (in bytes)the input length (in bytes) inLen)Implements abstract javax. |
| protected final AlgorithmParameters | Returns: the parameters used with this cipher, or null if this cipher does not use any parameters.Implements abstract javax. |
| protected final void | engineInit(int
the operation mode ( opMode, Key ENCRYPT_MODE or
DECRYPT_MODE)the key key, SecureRandom the random seed random)Implements abstract javax. |
| protected final void | engineInit(int
the operation mode ( opMode, Key ENCRYPT_MODE or
DECRYPT_MODE)the key key, AlgorithmParameters the algorithm parameters algParams, SecureRandom the random seed random)Implements abstract javax. |
| protected void | engineInit(int
the operation mode ( opMode, Key ENCRYPT_MODE or
DECRYPT_MODE)the encryption key key, AlgorithmParameterSpec the algorithm parameters params, SecureRandom the source of randomness javaRand)Implements abstract javax. |
| protected final void | engineSetMode(String
the cipher mode modeName)Implements abstract javax. |
| protected final void | engineSetPadding(String
the padding scheme paddingName)Implements abstract javax. |
| protected final byte[] | Returns: the byte array containing the en-/decrypted datathe byte array holding the data to be processed input, int the offset indicating the start position within the input
byte array inOff, int the number of bytes to be processed inLen)Implements abstract javax. |
| protected final int | Returns: the number of bytes that are stored in the output byte arraythe byte array holding the data to be processed input, final int the offset indicating the start position within the input
byte array inOff, final int the number of bytes to be processed inLen, byte[] the byte array for holding the result output, final int the offset indicating the start position within the output
byte array to which the en-/decrypted data is written outOff)Implements abstract javax. |
| public abstract int | Returns: the block size (in bytes), or 0 if the underlying algorithm is not a block cipher
|
| public abstract byte[] | Returns: the initialization vector in a new buffer, or null if the underlying algorithm does not use an IV, or if the IV has not yet been set.Return the initialization vector. |
| public abstract int | Returns: the key size in bits of the given key objectthe key object key)Return the key size of the given key object in bits. |
| public abstract String | |
| public abstract int | Returns: the required output buffer size (in bytes)the input length (in bytes) 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). |
| public abstract AlgorithmParameterSpec | Returns: the parameters used with this cipher, or null if this cipher does not use any parameters.Returns the parameters used with this cipher. |
| public abstract void | initDecrypt(Key
the encryption key key, AlgorithmParameterSpec the cipher parameters cipherParams)Initialize this cipher with a key, a set of algorithm parameters, and a source of randomness for decryption. |
| public abstract void | initEncrypt(Key
the encryption key key, AlgorithmParameterSpec the cipher parameters cipherParams, SecureRandom the source of randomness random)Initialize this cipher with a key, a set of algorithm parameters, and a source of randomness for encryption. |
| protected abstract void | |
| protected abstract void | |
| public final byte[] | Returns: a new buffer with the result (maybe an empty byte array)the input buffer input)Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| public abstract byte[] | Returns: a new buffer with the result (maybe an empty byte array)the input buffer input, int the offset where the input starts inOff, int the input length inLen)Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| public abstract int | Returns: the length of the outputthe input buffer input, int the offset where the input starts inOff, int the input length inLen, byte[] the output buffer output, int the offset where the result is stored outOff)Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| DECRYPT_MODE | back to summary |
|---|---|
| public static final int DECRYPT_MODE Constant specifying decrypt mode. | |
| ENCRYPT_MODE | back to summary |
|---|---|
| public static final int ENCRYPT_MODE Constant specifying encrypt mode. | |
| opMode | back to summary |
|---|---|
| protected int opMode The operation mode for this cipher ( | |
| CipherSpiExt | back to summary |
|---|---|
| public CipherSpiExt() | |
| doFinal | back to summary |
|---|---|
| public final byte[] doFinal() throws IllegalBlockSizeException, BadPaddingException Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized).
| |
| doFinal | back to summary |
|---|---|
| public final byte[] doFinal(byte[] input) throws IllegalBlockSizeException, BadPaddingException Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized).
| |
| doFinal | back to summary |
|---|---|
| public abstract byte[] doFinal(byte[] input, int inOff, int inLen) throws IllegalBlockSizeException, BadPaddingException Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized).
| |
| doFinal | back to summary |
|---|---|
| public abstract int doFinal(byte[] input, int inOff, int inLen, byte[] output, int outOff) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized).
| |
| engineDoFinal | back to summary |
|---|---|
| protected final byte[] engineDoFinal(byte[] input, int inOff, int inLen) throws IllegalBlockSizeException, BadPaddingException Implements abstract javax. Return the result of the last step of a multi-step en-/decryption operation or the result of a single-step en-/decryption operation by processing the given input data and any remaining buffered data. The data to be processed is given in an input byte array. Beginning at inputOffset, only the first inputLen bytes are en-/decrypted, including any buffered bytes of a previous update operation. If necessary, padding is performed. The result is returned as a output byte array.
| |
| engineDoFinal | back to summary |
|---|---|
| protected final int engineDoFinal(byte[] input, int inOff, int inLen, byte[] output, int outOff) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Implements abstract javax. Perform the last step of a multi-step en-/decryption operation or a single-step en-/decryption operation by processing the given input data and any remaining buffered data. The data to be processed is given in an input byte array. Beginning at inputOffset, only the first inputLen bytes are en-/decrypted, including any buffered bytes of a previous update operation. If necessary, padding is performed. The result is stored in the given output byte array, beginning at outputOffset. The number of bytes stored in this byte array are returned.
| |
| engineGetBlockSize | back to summary |
|---|---|
| protected final int engineGetBlockSize() Implements abstract javax. Doc from javax. Returns the block size (in bytes).
| |
| engineGetIV | back to summary |
|---|---|
| protected final byte[] engineGetIV() Implements abstract javax. Return the initialization vector. This is useful in the context of password-based encryption or decryption, where the IV is derived from a user-provided passphrase.
| |
| engineGetKeySize | back to summary |
|---|---|
| protected final int engineGetKeySize(Key key) throws InvalidKeyException Overrides javax. Return the key size of the given key object in bits.
| |
| engineGetOutputSize | back to summary |
|---|---|
| protected final int engineGetOutputSize(int inLen) Implements abstract javax. Return 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). This call takes into account any unprocessed (buffered) data from a previous update call, and padding. The actual output length of the next update or doFinal call may be smaller than the length returned by this method.
| |
| engineGetParameters | back to summary |
|---|---|
| protected final AlgorithmParameters engineGetParameters() Implements abstract javax. Returns the parameters used with this cipher. The returned parameters may be the same that were used to initialize this cipher, or may contain the default set of parameters or a set of randomly generated parameters used by the underlying cipher implementation (provided that the underlying cipher implementation uses a default set of parameters or creates new parameters if it needs parameters but was not initialized with any).
| |
| engineInit | back to summary |
|---|---|
| protected final void engineInit(int opMode, Key key, SecureRandom random) throws InvalidKeyException Implements abstract javax. Initialize this cipher object with a proper key and some random seed. Before a cipher object is ready for data processing, it has to be initialized according to the desired cryptographic operation, which is specified by the opMode parameter. If this cipher (including its underlying mode or padding scheme) requires any random bytes, it will obtain them from random. Note If the mode needs an initialization vector, a blank array is used in this case.
| |
| engineInit | back to summary |
|---|---|
| protected final void engineInit(int opMode, Key key, AlgorithmParameters algParams, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Initialize this cipher with a key, a set of algorithm parameters, and a source of randomness. The cipher is initialized for encryption or decryption, depending on the value of opMode. If this cipher (including its underlying mode or padding scheme) requires any random bytes, it will obtain them from random. Note that when a cipher object is initialized, it loses all previously-acquired state. In other words, initializing a Cipher is equivalent to creating a new instance of that Cipher and initializing it. Note If the mode needs an initialization vector, a try to retrieve it from the AlgorithmParametersSpec is made.
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opMode, Key key, AlgorithmParameterSpec params, SecureRandom javaRand) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Initialize this cipher with a key, a set of algorithm parameters, and a source of randomness. The cipher is initialized for one of the following four operations: encryption, decryption, key wrapping or key unwrapping, depending on the value of opMode. If this cipher (including its underlying feedback or padding scheme) requires any random bytes (e.g., for parameter generation), it will get them from random. Note that when a Cipher object is initialized, it loses all previously-acquired state. In other words, initializing a Cipher is equivalent to creating a new instance of that Cipher and initializing it.
| |
| engineSetMode | back to summary |
|---|---|
| protected final void engineSetMode(String modeName) throws NoSuchAlgorithmException Implements abstract javax. Set the mode of this cipher.
| |
| engineSetPadding | back to summary |
|---|---|
| protected final void engineSetPadding(String paddingName) throws NoSuchPaddingException Implements abstract javax. Set the padding scheme of this cipher.
| |
| engineUpdate | back to summary |
|---|---|
| protected final byte[] engineUpdate(byte[] input, int inOff, int inLen) Implements abstract javax. Return the result of the next step of a multi-step en-/decryption operation. The data to be processed is given in an input byte array. Beginning at inputOffset, only the first inputLen bytes are en-/decrypted. The result is returned as a byte array.
| |
| engineUpdate | back to summary |
|---|---|
| protected final int engineUpdate(final byte[] input, final int inOff, final int inLen, byte[] output, final int outOff) throws ShortBufferException Implements abstract javax. Perform the next step of a multi-step en-/decryption operation. The data to be processed is given in an input byte array. Beginning at inputOffset, only the first inputLen bytes are en-/decrypted. The result is stored in the given output byte array, beginning at outputOffset. The number of bytes stored in this output byte array are returned.
| |
| getBlockSize | back to summary |
|---|---|
public abstract int getBlockSize()
| |
| getIV | back to summary |
|---|---|
| public abstract byte[] getIV() Return the initialization vector. This is useful in the context of password-based encryption or decryption, where the IV is derived from a user-provided passphrase.
| |
| getKeySize | back to summary |
|---|---|
| public abstract int getKeySize(Key key) throws InvalidKeyException Return the key size of the given key object in bits.
| |
| getName | back to summary |
|---|---|
public abstract String getName()
| |
| getOutputSize | back to summary |
|---|---|
| public abstract int getOutputSize(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). This call takes into account any unprocessed (buffered) data from a previous update call, and padding. The actual output length of the next update or doFinal call may be smaller than the length returned by this method.
| |
| getParameters | back to summary |
|---|---|
| public abstract AlgorithmParameterSpec getParameters() Returns the parameters used with this cipher. The returned parameters may be the same that were used to initialize this cipher, or may contain the default set of parameters or a set of randomly generated parameters used by the underlying cipher implementation (provided that the underlying cipher implementation uses a default set of parameters or creates new parameters if it needs parameters but was not initialized with any).
| |
| initDecrypt | back to summary |
|---|---|
| public abstract void initDecrypt(Key key, AlgorithmParameterSpec cipherParams) throws InvalidKeyException, InvalidAlgorithmParameterException Initialize this cipher with a key, a set of algorithm parameters, and a source of randomness for decryption.
If this cipher requires any algorithm parameters and paramSpec is null,
the underlying cipher implementation is supposed to generate the required
parameters itself (using provider-specific default or random values) if
it is being initialized for encryption, and throw an
If this cipher (including its underlying feedback or padding scheme) requires any random bytes (e.g., for parameter generation), it will get them from random. Note that when a cipher object is initialized, it loses all previously-acquired state. In other words, initializing a Cipher is equivalent to creating a new instance of that Cipher and initializing it.
| |
| initEncrypt | back to summary |
|---|---|
| public abstract void initEncrypt(Key key, AlgorithmParameterSpec cipherParams, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Initialize this cipher with a key, a set of algorithm parameters, and a source of randomness for encryption. If this cipher requires any algorithm parameters and paramSpec is null, the underlying cipher implementation is supposed to generate the required parameters itself (using provider-specific default or random values) if it is being initialized for encryption, and raise an InvalidAlgorithmParameterException if it is being initialized for decryption. The generated parameters can be retrieved using engineGetParameters or engineGetIV (if the parameter is an IV). If this cipher (including its underlying feedback or padding scheme) requires any random bytes (e.g., for parameter generation), it will get them from random. Note that when a cipher object is initialized, it loses all previously-acquired state. In other words, initializing a Cipher is equivalent to creating a new instance of that Cipher and initializing it.
| |
| setMode | back to summary |
|---|---|
| protected abstract void setMode(String mode) throws NoSuchAlgorithmException Set the mode of this cipher.
| |
| setPadding | back to summary |
|---|---|
| protected abstract void setPadding(String padding) throws NoSuchPaddingException Set the padding mechanism of this cipher.
| |
| update | back to summary |
|---|---|
| public final byte[] update(byte[] input) Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.
| |
| update | back to summary |
|---|---|
| public abstract byte[] update(byte[] input, int inOff, int inLen) Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.
| |
| update | back to summary |
|---|---|
| public abstract int update(byte[] input, int inOff, int inLen, byte[] output, int outOff) throws ShortBufferException Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.
| |