| Modifier and Type | Field and Description |
|---|---|
protected AlgorithmParameters |
engineParams |
protected Wrapper |
wrapEngine |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseCipherSpi() |
| Modifier and Type | Method and Description |
|---|---|
protected AlgorithmParameters |
createParametersInstance(String algorithm) |
protected int |
engineGetBlockSize()
Returns the block size of this cipher (in bytes)
|
protected byte[] |
engineGetIV()
Returns the Initialization Vector (IV) that was used to initialize this
cipher or
null if none was used. |
protected int |
engineGetKeySize(Key key)
Returns the size of a specified key object in bits.
|
protected int |
engineGetOutputSize(int inputLen)
Returns the size for a buffer (in bytes), that the next call to
update of doFinal would return, taking into account any buffered
data from previous update calls and padding. |
protected AlgorithmParameters |
engineGetParameters()
Returns the parameters that where used to create this cipher instance.
|
protected void |
engineSetMode(String mode)
Sets the mode for this cipher.
|
protected void |
engineSetPadding(String padding)
Sets the padding method for this cipher.
|
protected Key |
engineUnwrap(byte[] wrappedKey,
String wrappedKeyAlgorithm,
int wrappedKeyType)
Unwraps a key using this cipher instance.
|
protected byte[] |
engineWrap(Key key)
Wraps a key using this cipher instance.
|
engineDoFinal, engineDoFinal, engineDoFinal, engineInit, engineInit, engineInit, engineUpdate, engineUpdate, engineUpdate, engineUpdateAAD, engineUpdateAADprotected AlgorithmParameters engineParams
protected Wrapper wrapEngine
protected int engineGetBlockSize()
CipherSpiengineGetBlockSize in class CipherSpiprotected byte[] engineGetIV()
CipherSpinull if none was used.engineGetIV in class CipherSpinull if none was used.protected int engineGetKeySize(Key key)
CipherSpiUnsupportedOperationException.engineGetKeySize in class CipherSpikey - the key to get the size for.protected int engineGetOutputSize(int inputLen)
CipherSpiupdate of doFinal would return, taking into account any buffered
data from previous update calls and padding.
The actual output length of the next call to update or doFinal may be smaller than the length returned by this method.
engineGetOutputSize in class CipherSpiinputLen - the length of the input (in bytes).protected AlgorithmParameters engineGetParameters()
CipherSpiThese may be a the same parameters that were used to create this cipher instance, or may be a combination of default and random parameters, depending on the underlying cipher implementation.
engineGetParameters in class CipherSpinull if this cipher instance does not have any parameters
at all.protected final AlgorithmParameters createParametersInstance(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException
protected void engineSetMode(String mode) throws NoSuchAlgorithmException
CipherSpiengineSetMode in class CipherSpimode - the name of the cipher mode.NoSuchAlgorithmException - if the specified cipher mode is not supported by this
provider.protected void engineSetPadding(String padding) throws NoSuchPaddingException
CipherSpiengineSetPadding in class CipherSpipadding - the name of the padding method.NoSuchPaddingException - if the specified padding method is not supported by this
cipher.protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException
CipherSpiUnsupportedOperationException.engineWrap in class CipherSpikey - the key to wrap.IllegalBlockSizeException - if the size of the resulting bytes is not a multiple of the
cipher block size.InvalidKeyException - if this cipher instance cannot wrap this key.protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException
CipherSpi
This method has been added to this class (for backwards compatibility, it
cannot be abstract). If this method is not overridden, it throws an
UnsupportedOperationException.
engineUnwrap in class CipherSpiwrappedKey - the wrapped key to unwrap.wrappedKeyAlgorithm - the algorithm for the wrapped key.wrappedKeyType - the type of the wrapped key (one of: SECRET_KEY,
PRIVATE_KEY or PUBLIC_KEY)InvalidKeyException - if the wrappedKey cannot be unwrapped to a key of
type wrappedKeyType for the wrappedKeyAlgorithm.