Note
Some Ciphers are using Padding. OneAndZeroesPadding is used as default padding. However padding can still be specified, but mode is not supported; if you try to instantiate the cipher with something else than "NONE" as mode, NoSuchAlgorithmException is thrown.
| Modifier and Type | Field and Description |
|---|---|
| protected AlgorithmParameterSpec | paramSpec
ParameterSpec used with this cipher |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract int | Returns: the output sizethe length of the input inLen)Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in decryption mode when given input of the specified length. |
| 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)Implements abstract org. |
| public final 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)Implements abstract org. |
| protected abstract int | Returns: the output sizethe length of the input inLen)Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in encryption mode when given input of the specified length. |
| public final int | Returns: 0 since the implementing algorithms are not block ciphersImplements abstract org. |
| public final byte[] | Returns: null since no initialization vector is used.Implements abstract org. |
| public final int | Returns: the length of the output of the next update() or doFinal() callthe length of the input inLen)Implements abstract org. |
| public final AlgorithmParameterSpec | Returns: the parameters used with this cipher, or null if this cipher does not use any parameters.Implements abstract org. |
| protected abstract void | initCipherDecrypt(Key
the key which has to be used to decrypt data key, AlgorithmParameterSpec the algorithm parameters params)Initialize the AsymmetricHybridCipher with a certain key for data encryption. |
| protected abstract void | initCipherEncrypt(Key
the key which has to be used to encrypt data key, AlgorithmParameterSpec the algorithm parameters params, SecureRandom the source of randomness sr)Initialize the AsymmetricHybridCipher with a certain key for data encryption. |
| public final void | initDecrypt(Key
the decryption key key)Initialize the cipher for decryption by forwarding it to initDecrypt(Key, FlexiSecureRandom). |
| public final void | initDecrypt(Key
the decryption key key, AlgorithmParameterSpec the algorithm parameters params)Implements abstract org. |
| public final void | initEncrypt(Key
the encryption key key)Initialize the cipher for encryption by forwarding it to
|
| public final void | initEncrypt(Key
the encryption key key, SecureRandom the source of randomness random)Initialize this cipher for encryption by forwarding it to
|
| public final void | initEncrypt(Key
the encryption key key, AlgorithmParameterSpec the algorithm parameters params)Initialize the cipher for encryption by forwarding it to initEncrypt(Key, FlexiSecureRandom, AlgorithmParameterSpec). |
| public final void | initEncrypt(Key
the encryption key key, AlgorithmParameterSpec the algorithm parameters params, SecureRandom the source of randomness random)Implements abstract org. |
| protected final void | setMode(String
the cipher mode (unused) modeName)Implements abstract org. |
| protected final void | setPadding(String
the name of the padding scheme (not used) paddingName)Implements abstract org. |
| 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)Implements abstract org. |
| public final 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)Implements abstract org. |
| paramSpec | back to summary |
|---|---|
| protected AlgorithmParameterSpec paramSpec ParameterSpec used with this cipher | |
| AsymmetricHybridCipher | back to summary |
|---|---|
| public AsymmetricHybridCipher() | |
| decryptOutputSize | back to summary |
|---|---|
| protected abstract int decryptOutputSize(int inLen) Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in decryption mode when given input of the specified length.
| |
| doFinal | back to summary |
|---|---|
| public abstract byte[] doFinal(byte[] input, int inOff, int inLen) throws BadPaddingException Implements abstract org. Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized).
| |
| doFinal | back to summary |
|---|---|
| public final int doFinal(byte[] input, int inOff, int inLen, byte[] output, int outOff) throws ShortBufferException, BadPaddingException Implements abstract org. Finish a multiple-part encryption or decryption operation (depending on how this cipher was initialized).
| |
| encryptOutputSize | back to summary |
|---|---|
| protected abstract int encryptOutputSize(int inLen) Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in encryption mode when given input of the specified length.
| |
| getBlockSize | back to summary |
|---|---|
| public final int getBlockSize() Implements abstract org.
| |
| getIV | back to summary |
|---|---|
| public final byte[] getIV() Implements abstract org. Doc from org. 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.
| |
| getOutputSize | back to summary |
|---|---|
| public final int getOutputSize(int inLen) Implements abstract org. 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 inLen (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 final AlgorithmParameterSpec getParameters() Implements abstract org. Return 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).
| |
| initCipherDecrypt | back to summary |
|---|---|
| protected abstract void initCipherDecrypt(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initialize the AsymmetricHybridCipher with a certain key for data encryption.
| |
| initCipherEncrypt | back to summary |
|---|---|
| protected abstract void initCipherEncrypt(Key key, AlgorithmParameterSpec params, SecureRandom sr) throws InvalidKeyException, InvalidAlgorithmParameterException Initialize the AsymmetricHybridCipher with a certain key for data encryption.
| |
| initDecrypt | back to summary |
|---|---|
| public final void initDecrypt(Key key) throws InvalidKeyException Initialize the cipher for decryption by forwarding it to initDecrypt(Key, FlexiSecureRandom).
If this cipher requires any algorithm parameters that cannot be derived
from the given key, 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
InvalidKeyException if it is being initialized for decryption. The
generated parameters can be retrieved using
| |
| initDecrypt | back to summary |
|---|---|
| public final void initDecrypt(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract org. Initialize the cipher with a certain key for data decryption. If this cipher 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 final void initEncrypt(Key key) throws InvalidKeyException Initialize the cipher for encryption by forwarding it to
If this cipher requires any algorithm parameters that cannot be derived
from the given key, 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
InvalidKeyException if it is being initialized for decryption. The
generated parameters can be retrieved using
| |
| initEncrypt | back to summary |
|---|---|
| public final void initEncrypt(Key key, SecureRandom random) throws InvalidKeyException Initialize this cipher for encryption by forwarding it to
If this cipher requires any algorithm parameters that cannot be derived
from the given key, 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
InvalidKeyException if it is being initialized for decryption. The
generated parameters can be retrieved using
| |
| initEncrypt | back to summary |
|---|---|
| public final void initEncrypt(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initialize the cipher for encryption by forwarding it to initEncrypt(Key, FlexiSecureRandom, AlgorithmParameterSpec).
| |
| initEncrypt | back to summary |
|---|---|
| public final void initEncrypt(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract org. Initialize the cipher with a certain key for data encryption. If this cipher 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 final void setMode(String modeName) Implements abstract org. Since asymmetric hybrid ciphers do not support modes, this method does nothing.
| |
| setPadding | back to summary |
|---|---|
| protected final void setPadding(String paddingName) Implements abstract org. Since asymmetric hybrid ciphers do not support padding, this method does nothing.
| |
| update | back to summary |
|---|---|
| public abstract byte[] update(byte[] input, int inOff, int inLen) Implements abstract org. Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.
| |
| update | back to summary |
|---|---|
| public final int update(byte[] input, int inOff, int inLen, byte[] output, int outOff) throws ShortBufferException Implements abstract org. Continue a multiple-part encryption or decryption operation (depending on how this cipher was initialized), processing another data part.
| |