Cipher using BoringSSL as the backing library.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | OpenSSLCipher.Mode
Modes that a block cipher may support. |
| pack-priv static enum | OpenSSLCipher.Padding
Paddings that a block cipher may support. |
| Modifier and Type | Field and Description |
|---|---|
| private int | blockSize
The block size of the current cipher. |
| pack-priv byte[] | encodedKey
May be used when reseting the cipher instance after calling
|
| private boolean | encrypting
Current cipher mode: encrypting or decrypting. |
| pack-priv byte[] | iv
The Initial Vector (IV) used for the current cipher. |
| pack-priv OpenSSLCipher. | mode
The current cipher mode. |
| private OpenSSLCipher. | padding
The current cipher padding. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | |
| pack-priv abstract void | checkSupportedKeySize(int keySize)
Checks whether the cipher supports this particular |
| pack-priv abstract void | checkSupportedMode(OpenSSLCipher.
Checks whether the cipher supports this particular cipher |
| pack-priv abstract void | checkSupportedPadding(OpenSSLCipher.
Checks whether the cipher supports this particular cipher |
| pack-priv abstract int | doFinalInternal(byte[] output, int outputOffset, int maximumLen)
API-specific implementation of the final block. |
| protected byte[] | engineDoFinal(byte[]
the input buffer input, int the offset in inputOffset, int input where the input startsthe input length inputLen)Implements abstract javax. |
| protected int | engineDoFinal(byte[]
the 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 storedImplements abstract javax. |
| protected int | engineGetBlockSize()
Implements abstract javax. |
| protected byte[] | engineGetIV()
Implements abstract javax. |
| protected int | engineGetKeySize(Key
the key object key)Overrides javax. |
| protected int | engineGetOutputSize(int
the input length (in bytes) inputLen)Implements abstract javax. update
or doFinal operation, given the input length
inputLen (in bytes).
|
| protected AlgorithmParameters | engineGetParameters()
Implements abstract javax. |
| protected void | engineInit(int
the operation mode of this opmode, Key CipherSpi object
(this is one of the following:
ENCRYPT_MODE, DECRYPT_MODE,
WRAP_MODE or UNWRAP_MODE)the encryption key key, SecureRandom the source of randomness random)Implements abstract javax. CipherSpi object with a key and a source
of randomness.
|
| protected void | engineInit(int
the operation mode of this opmode, Key CipherSpi object
(this is one of the following:
ENCRYPT_MODE, DECRYPT_MODE,
WRAP_MODE, or UNWRAP_MODE)the encryption key key, AlgorithmParameterSpec the algorithm parameters params, SecureRandom the source of randomness random)Implements abstract javax. CipherSpi object with a key, a set of
algorithm parameters, and a source of randomness.
|
| protected void | engineInit(int
the operation mode of this opmode, Key CipherSpi object
(this is one of the following:
ENCRYPT_MODE, DECRYPT_MODE,
WRAP_MODE, or UNWRAP_MODE)the encryption key key, AlgorithmParameters the algorithm parameters params, SecureRandom the source of randomness random)Implements abstract javax. CipherSpi object with a key, a set of
algorithm parameters, and a source of randomness.
|
| pack-priv abstract void | engineInitInternal(byte[] encodedKey, AlgorithmParameterSpec params, SecureRandom random)
API-specific implementation of initializing the cipher. |
| protected void | engineSetMode(String
the cipher mode modeStr)Implements abstract javax. |
| protected void | engineSetPadding(String
the padding mechanism paddingStr)Implements abstract javax. |
| protected Key | engineUnwrap(byte[]
the key to be unwrapped wrappedKey, String the algorithm associated with the wrapped
key wrappedKeyAlgorithm, int the type of the wrapped key. This is one of
wrappedKeyType)SECRET_KEY, PRIVATE_KEY, or PUBLIC_KEY.Overrides javax. |
| protected byte[] | engineUpdate(byte[]
the input buffer input, int the offset in inputOffset, int input where the input startsthe input length inputLen)Implements abstract javax. CipherSpi object was initialized),
processing another data part.
|
| protected int | engineUpdate(byte[]
the 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 storedImplements abstract javax. CipherSpi object was initialized),
processing another data part.
|
| protected byte[] | |
| pack-priv abstract String | |
| pack-priv abstract int | |
| pack-priv abstract int | |
| pack-priv abstract int | |
| pack-priv OpenSSLCipher. | |
| protected AlgorithmParameterSpec | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv abstract int | updateInternal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset, int maximumLen)
API-specific implementation of updating the cipher. |
| blockSize | back to summary |
|---|---|
| private int blockSize The block size of the current cipher. | |
| encodedKey | back to summary |
|---|---|
| pack-priv byte[] encodedKey May be used when reseting the cipher instance after calling
| |
| encrypting | back to summary |
|---|---|
| private boolean encrypting Current cipher mode: encrypting or decrypting. | |
| iv | back to summary |
|---|---|
| pack-priv byte[] iv The Initial Vector (IV) used for the current cipher. | |
| mode | back to summary |
|---|---|
| pack-priv OpenSSLCipher. The current cipher mode. | |
| padding | back to summary |
|---|---|
| private OpenSSLCipher. The current cipher padding. | |
| OpenSSLCipher | back to summary |
|---|---|
| pack-priv OpenSSLCipher() | |
| OpenSSLCipher | back to summary |
|---|---|
| pack-priv OpenSSLCipher(OpenSSLCipher. | |
| checkAndSetEncodedKey | back to summary |
|---|---|
| private byte[] checkAndSetEncodedKey(int opmode, Key key) throws InvalidKeyException | |
| checkSupportedKeySize | back to summary |
|---|---|
| pack-priv abstract void checkSupportedKeySize(int keySize) throws InvalidKeyException Checks whether the cipher supports this particular | |
| checkSupportedMode | back to summary |
|---|---|
| pack-priv abstract void checkSupportedMode(OpenSSLCipher. Checks whether the cipher supports this particular cipher | |
| checkSupportedPadding | back to summary |
|---|---|
| pack-priv abstract void checkSupportedPadding(OpenSSLCipher. Checks whether the cipher supports this particular cipher | |
| doFinalInternal | back to summary |
|---|---|
| pack-priv abstract int doFinalInternal(byte[] output, int outputOffset, int maximumLen) throws IllegalBlockSizeException, BadPaddingException, ShortBufferException API-specific implementation of the final block. The | |
| engineDoFinal | back to summary |
|---|---|
| protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException Implements abstract javax. Doc from javax. 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
The first Upon finishing, this method resets this Note if any exception is thrown, this
| |
| engineDoFinal | back to summary |
|---|---|
| protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException Implements abstract javax. Doc from javax. 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
The first If the Upon finishing, this method resets this Note if any exception is thrown, this
| |
| engineGetBlockSize | back to summary |
|---|---|
| protected int engineGetBlockSize() Implements abstract javax. Doc from javax. Returns the block size (in bytes).
| |
| engineGetIV | back to summary |
|---|---|
| protected byte[] engineGetIV() Implements abstract javax. Doc from javax. Returns the initialization vector (IV) in a new buffer. 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 int engineGetKeySize(Key key) throws InvalidKeyException Overrides javax. Doc from javax. Returns the key size of the given key object in bits. This concrete method has been added to this previously-defined
abstract class. It throws an
| |
| engineGetOutputSize | back to summary |
|---|---|
| protected int engineGetOutputSize(int inputLen) Implements abstract javax. Doc from javax. 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
| |
| engineGetParameters | back to summary |
|---|---|
| protected AlgorithmParameters engineGetParameters() Implements abstract javax. Doc from 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 additional default or random parameter
values used by the underlying cipher implementation. If the required
parameters were not supplied and can be generated by the cipher, the
generated parameters are returned. Otherwise,
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, SecureRandom random) throws InvalidKeyException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters that cannot be
derived from the given If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters and
If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException Implements abstract javax. Doc from javax. Initializes this The If this cipher requires any algorithm parameters and
If this cipher requires algorithm parameters that cannot be derived from the input parameters, and there are no reasonable provider-specific default values, initialization will necessarily fail. If this cipher (including its feedback or padding scheme)
requires any random bytes (e.g., for parameter generation), it will get
them from Note that when a
| |
| engineInitInternal | back to summary |
|---|---|
| pack-priv abstract void engineInitInternal(byte[] encodedKey, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException API-specific implementation of initializing the cipher. The
| |
| engineSetMode | back to summary |
|---|---|
| protected void engineSetMode(String modeStr) throws NoSuchAlgorithmException Implements abstract javax. Doc from javax. Sets the mode of this cipher.
| |
| engineSetPadding | back to summary |
|---|---|
| protected void engineSetPadding(String paddingStr) throws NoSuchPaddingException Implements abstract javax. Doc from javax. Sets the padding mechanism of this cipher.
| |
| engineUnwrap | back to summary |
|---|---|
| protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException Overrides javax. Doc from javax. Unwrap a previously wrapped key. This concrete method has been added to this previously-defined
abstract class. (For backwards compatibility, it cannot be abstract.)
It may be overridden by a provider to unwrap a previously wrapped key.
Such an override is expected to throw an
| |
| engineUpdate | back to summary |
|---|---|
| protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLen) Implements abstract javax. Doc from javax. Continues a multiple-part encryption or decryption operation
(depending on how this The first
| |
| engineUpdate | back to summary |
|---|---|
| protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException Implements abstract javax. Doc from javax. Continues a multiple-part encryption or decryption operation
(depending on how this The first If the
| |
| engineWrap | back to summary |
|---|---|
| protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException Overrides javax. Doc from javax. Wrap a key. This concrete method has been added to this previously-defined
abstract class. (For backwards compatibility, it cannot be abstract.)
It may be overridden by a provider to wrap a key.
Such an override is expected to throw an
| |
| getBaseCipherName | back to summary |
|---|---|
| pack-priv abstract String getBaseCipherName() Returns the standard name for the particular algorithm. | |
| getCipherBlockSize | back to summary |
|---|---|
| pack-priv abstract int getCipherBlockSize() | |
| getOutputSizeForFinal | back to summary |
|---|---|
| pack-priv abstract int getOutputSizeForFinal(int inputLen) The size of output if | |
| getOutputSizeForUpdate | back to summary |
|---|---|
| pack-priv abstract int getOutputSizeForUpdate(int inputLen) The size of output if | |
| getPadding | back to summary |
|---|---|
| pack-priv OpenSSLCipher. Returns the padding type for which this cipher is initialized. | |
| getParameterSpec | back to summary |
|---|---|
| protected AlgorithmParameterSpec getParameterSpec(AlgorithmParameters params) throws InvalidAlgorithmParameterException | |
| isEncrypting | back to summary |
|---|---|
| pack-priv boolean isEncrypting() | |
| supportsVariableSizeIv | back to summary |
|---|---|
| pack-priv boolean supportsVariableSizeIv() | |
| supportsVariableSizeKey | back to summary |
|---|---|
| pack-priv boolean supportsVariableSizeKey() | |
| updateInternal | back to summary |
|---|---|
| pack-priv abstract int updateInternal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset, int maximumLen) throws ShortBufferException API-specific implementation of updating the cipher. The
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static OpenSSLCipher. | |
| public static OpenSSLCipher. | |
| public static OpenSSLCipher. |
| CBC | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| CTR | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| ECB | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| GCM | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| GCM_SIV | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| NONE | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| POLY1305 | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| Mode | back to summary |
|---|---|
| private Mode() | |
| getNormalized | back to summary |
|---|---|
| public static OpenSSLCipher. | |
| valueOf | back to summary |
|---|---|
| public static OpenSSLCipher. | |
| values | back to summary |
|---|---|
| public static OpenSSLCipher. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. | |
| public static final OpenSSLCipher. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static OpenSSLCipher. | |
| public static OpenSSLCipher. | |
| public static OpenSSLCipher. |
| NOPADDING | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| PKCS5PADDING | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| PKCS7PADDING | back to summary |
|---|---|
| public static final OpenSSLCipher. | |
| Padding | back to summary |
|---|---|
| private Padding() | |
| getNormalized | back to summary |
|---|---|
| public static OpenSSLCipher. | |
| valueOf | back to summary |
|---|---|
| public static OpenSSLCipher. | |
| values | back to summary |
|---|---|
| public static OpenSSLCipher. | |