Class AESCipher
- java.lang.Object
-
- javax.crypto.CipherSpi
-
- com.fortanix.sdkms.jce.provider.ciphers.AESCipher
-
- Direct Known Subclasses:
AESCipher.Aes128CbcNOPadding
,AESCipher.Aes128CbcPKCS5Padding
,AESCipher.Aes128CcmPKCS5Padding
,AESCipher.Aes128CfbPKCS5Padding
,AESCipher.Aes128CtrPKCS5Padding
,AESCipher.Aes128EcbPKCS5Padding
,AESCipher.Aes128Ff1NOPadding
,AESCipher.Aes128FpeNOPadding
,AESCipher.Aes128GcmNoPadding
,AESCipher.Aes128GcmPKCS5Padding
,AESCipher.Aes128OfbPKCS5Padding
,AESCipher.Aes192CbcNOPadding
,AESCipher.Aes192CbcPKCS5Padding
,AESCipher.Aes192CcmPKCS5Padding
,AESCipher.Aes192CfbPKCS5Padding
,AESCipher.Aes192CtrPKCS5Padding
,AESCipher.Aes192EcbPKCS5Padding
,AESCipher.Aes192Ff1NOPadding
,AESCipher.Aes192FpeNOPadding
,AESCipher.Aes192GcmNoPadding
,AESCipher.Aes192GcmPKCS5Padding
,AESCipher.Aes192OfbPKCS5Padding
,AESCipher.Aes256CbcNOPadding
,AESCipher.Aes256CbcPKCS5Padding
,AESCipher.Aes256CcmPKCS5Padding
,AESCipher.Aes256CfbPKCS5Padding
,AESCipher.Aes256CtrPKCS5Padding
,AESCipher.Aes256EcbPKCS5Padding
,AESCipher.Aes256Ff1NOPadding
,AESCipher.Aes256FpeNOPadding
,AESCipher.Aes256GcmNoPadding
,AESCipher.Aes256GcmPKCS5Padding
,AESCipher.Aes256OfbPKCS5Padding
public abstract class AESCipher extends CipherSpi
AESCipher implements the AES algorithm in its various modes (ECB
,CFB
,OFB
,CBC
) and padding schemes (PKCS5Padding
,NoPadding
)
-
-
Nested Class Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
engineDoFinal(byte[] input, int inputOffset, int inputLen)
protected int
engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
protected int
engineGetBlockSize()
protected byte[]
engineGetIV()
protected int
engineGetKeySize(Key key)
protected int
engineGetOutputSize(int inputLength)
protected AlgorithmParameters
engineGetParameters()
protected void
engineInit(int opMode, Key key, AlgorithmParameters params, SecureRandom random)
protected void
engineInit(int opMode, Key key, SecureRandom random)
protected void
engineInit(int opMode, Key key, AlgorithmParameterSpec params, SecureRandom random)
protected void
engineSetMode(String mode)
protected void
engineSetPadding(String padding)
protected Key
engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType)
protected byte[]
engineUpdate(byte[] input, int inputOffset, int inputLength)
protected int
engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
protected void
engineUpdateAAD(byte[] src, int offset, int len)
protected void
engineUpdateAAD(ByteBuffer byteBuffer)
protected byte[]
engineWrap(Key key)
-
Methods inherited from class javax.crypto.CipherSpi
engineDoFinal, engineUpdate
-
-
-
-
Method Detail
-
engineDoFinal
protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException
- Specified by:
engineDoFinal
in classCipherSpi
- Throws:
IllegalBlockSizeException
BadPaddingException
-
engineDoFinal
protected int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException
- Specified by:
engineDoFinal
in classCipherSpi
- Throws:
ShortBufferException
IllegalBlockSizeException
BadPaddingException
-
engineGetBlockSize
protected int engineGetBlockSize()
- Specified by:
engineGetBlockSize
in classCipherSpi
-
engineGetIV
protected byte[] engineGetIV()
- Specified by:
engineGetIV
in classCipherSpi
-
engineGetKeySize
protected int engineGetKeySize(Key key) throws InvalidKeyException
- Overrides:
engineGetKeySize
in classCipherSpi
- Throws:
InvalidKeyException
-
engineGetOutputSize
protected int engineGetOutputSize(int inputLength)
- Specified by:
engineGetOutputSize
in classCipherSpi
-
engineGetParameters
protected AlgorithmParameters engineGetParameters()
- Specified by:
engineGetParameters
in classCipherSpi
-
engineInit
protected void engineInit(int opMode, Key key, SecureRandom random) throws InvalidKeyException
- Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
-
engineInit
protected void engineInit(int opMode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException
- Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineInit
protected void engineInit(int opMode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException
- Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineSetMode
protected void engineSetMode(String mode) throws NoSuchAlgorithmException
- Specified by:
engineSetMode
in classCipherSpi
- Throws:
NoSuchAlgorithmException
-
engineSetPadding
protected void engineSetPadding(String padding) throws NoSuchPaddingException
- Specified by:
engineSetPadding
in classCipherSpi
- Throws:
NoSuchPaddingException
-
engineUpdate
protected byte[] engineUpdate(byte[] input, int inputOffset, int inputLength)
- Specified by:
engineUpdate
in classCipherSpi
-
engineUpdate
protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException
- Specified by:
engineUpdate
in classCipherSpi
- Throws:
ShortBufferException
-
engineUpdateAAD
protected void engineUpdateAAD(byte[] src, int offset, int len)
- Overrides:
engineUpdateAAD
in classCipherSpi
-
engineWrap
protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException
- Overrides:
engineWrap
in classCipherSpi
- Throws:
IllegalBlockSizeException
InvalidKeyException
-
engineUnwrap
protected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException
- Overrides:
engineUnwrap
in classCipherSpi
- Parameters:
wrappedKeyType
- the type of the wrapped key. This is one ofCipher.SECRET_KEY
,Cipher.PRIVATE_KEY
, orCipher.PUBLIC_KEY
.wrappedKeyAlgorithm
- the type of key algorithm. This is one of the .....wrappedKeyType
- wrapped key type- Throws:
InvalidKeyException
NoSuchAlgorithmException
-
engineUpdateAAD
protected void engineUpdateAAD(ByteBuffer byteBuffer)
- Overrides:
engineUpdateAAD
in classCipherSpi
-
-