javax.crypto.Cipher
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final CipherCore | |
| private int | |
| private final MessageDigest | |
| private byte[] |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | |
| pack-priv byte[] | Returns: the new buffer with the resultthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen)Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| pack-priv int | Returns: the number of bytes stored inoutputthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen, byte[] the buffer for the result output, int the offset in outputOffset)output where the result
is storedEncrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. |
| private static byte[] | |
| pack-priv int | |
| pack-priv 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.Returns the initialization vector (IV) in a new buffer. |
| pack-priv 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 |
| pack-priv AlgorithmParameters | Returns: the parameters used with this cipher, or null if this cipher does not use any parameters.Returns the parameters used with this cipher. |
| pack-priv void | init(int
the operation mode of this cipher (this is one of
the following:
opmode, Key ENCRYPT_MODE, DECRYPT_MODE),
WRAP_MODE or UNWRAP_MODE)the encryption key key, AlgorithmParameterSpec the algorithm parameters params, SecureRandom the source of randomness random)Initializes this cipher with a key, a set of algorithm parameters, and a source of randomness. |
| pack-priv void | |
| private static boolean | |
| pack-priv void | |
| pack-priv void | |
| pack-priv Key | |
| pack-priv byte[] | Returns: the new buffer with the resultthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen)Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| pack-priv int | Returns: the number of bytes stored inoutputthe input buffer input, int the offset in inputOffset, int input where the input
startsthe input length inputLen, byte[] the buffer for the result output, int the offset in outputOffset)output where the result
is storedContinues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. |
| pack-priv byte[] |
| algo | back to summary |
|---|---|
| private final String algo | |
| cipher | back to summary |
|---|---|
| private final CipherCore cipher | |
| iCount | back to summary |
|---|---|
| private int iCount | |
| md | back to summary |
|---|---|
| private final MessageDigest md | |
| salt | back to summary |
|---|---|
| private byte[] salt | |
| PBES1Core | back to summary |
|---|---|
| pack-priv PBES1Core(String cipherAlg) throws NoSuchAlgorithmException, NoSuchPaddingException Creates an instance of PBE Cipher using the specified CipherSpi instance. | |
| deriveCipherKey | back to summary |
|---|---|
| private byte[] deriveCipherKey(byte[] passwdBytes) | |
| doFinal | back to summary |
|---|---|
| pack-priv byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized. The first The cipher is reset to its initial state (uninitialized) after this call.
| |
| doFinal | back to summary |
|---|---|
| pack-priv int doFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized. The first The cipher is reset to its initial state (uninitialized) after this call.
| |
| generateSalt | back to summary |
|---|---|
| private static byte[] generateSalt(String algo, SecureRandom sr) | |
| getBlockSize | back to summary |
|---|---|
| pack-priv int getBlockSize() Returns the block size (in bytes).
| |
| getIV | back to summary |
|---|---|
| pack-priv byte[] getIV() Returns the initialization vector (IV) in a new buffer. This is useful in the case where a random IV has been created (see init), or in the context of password-based encryption or decryption, where the IV is derived from a user-supplied password.
| |
| getOutputSize | back to summary |
|---|---|
| pack-priv 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 This call takes into account any unprocessed (buffered) data from a
previous The actual output length of the next
| |
| getParameters | back to summary |
|---|---|
| pack-priv AlgorithmParameters 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).
| |
| init | back to summary |
|---|---|
| pack-priv void init(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes 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 If this cipher (including its underlying feedback or padding scheme)
requires any random bytes, it will get them from
| |
| init | back to summary |
|---|---|
| pack-priv void init(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException | |
| isWeak | back to summary |
|---|---|
| private static boolean isWeak(byte[] s) | |
| setMode | back to summary |
|---|---|
| pack-priv void setMode(String mode) throws NoSuchAlgorithmException Sets the mode of this cipher. This algorithm can only be run in CBC mode.
| |
| setPadding | back to summary |
|---|---|
| pack-priv void setPadding(String paddingScheme) throws NoSuchPaddingException Sets the padding mechanism of this cipher. This algorithm only uses PKCS #5 padding.
| |
| unwrap | back to summary |
|---|---|
| pack-priv Key unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException Unwrap a previously wrapped key.
| |
| update | back to summary |
|---|---|
| pack-priv byte[] update(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. The first
| |
| update | back to summary |
|---|---|
| pack-priv int update(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException Continues a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part. The first
| |
| wrap | back to summary |
|---|---|
| pack-priv byte[] wrap(Key key) throws IllegalBlockSizeException, InvalidKeyException Wrap a key.
| |