java.lang.Object
javax.crypto.CipherSpi
org.refcodes.security.ext.chaos.ChaosCipherSpi
Thanks Christian Pontesegger for the very good example on "Writing your own
JCA extensions - a full cipher" at:
"http://codeandme.blogspot.de/2013/07/writing-your-own-jca-extensions-full.html"
and for the very good example on "Writing your own JCA extensions - a simple
digest " at:
"http://codeandme.blogspot.de/2013/06/writing-your-own-jca-extensions-simple.html"
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
engineDoFinal
(byte[] aInput, int aInputOffset, int aInputLength) protected int
engineDoFinal
(byte[] aInput, int aInputOffset, int aInputLength, byte[] output, int outputOffset) protected int
protected byte[]
protected int
engineGetKeySize
(Key key) protected int
engineGetOutputSize
(int aInputLength) protected AlgorithmParameters
protected void
engineInit
(int opmode, Key key, AlgorithmParameters aParams, SecureRandom aRandom) protected void
engineInit
(int aMode, Key aKey, SecureRandom aRandom) protected void
engineInit
(int opmode, Key key, AlgorithmParameterSpec aParams, SecureRandom aRandom) protected void
engineSetMode
(String aMode) protected void
engineSetPadding
(String aPading) protected byte[]
engineUpdate
(byte[] aInput, int aInputOffset, int aInputLength) protected int
engineUpdate
(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset) Methods inherited from class javax.crypto.CipherSpi
engineDoFinal, engineUnwrap, engineUpdate, engineUpdateAAD, engineUpdateAAD, engineWrap
-
Constructor Details
-
ChaosCipherSpi
public ChaosCipherSpi()
-
-
Method Details
-
engineDoFinal
protected byte[] engineDoFinal(byte[] aInput, int aInputOffset, int aInputLength) throws IllegalBlockSizeException, BadPaddingException - Specified by:
engineDoFinal
in classCipherSpi
- Throws:
IllegalBlockSizeException
BadPaddingException
-
engineDoFinal
protected int engineDoFinal(byte[] aInput, int aInputOffset, int aInputLength, 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
-
engineGetOutputSize
protected int engineGetOutputSize(int aInputLength) - Specified by:
engineGetOutputSize
in classCipherSpi
-
engineGetParameters
- Specified by:
engineGetParameters
in classCipherSpi
-
engineInit
- Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
-
engineInit
protected void engineInit(int opmode, Key key, AlgorithmParameterSpec aParams, SecureRandom aRandom) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineInit
protected void engineInit(int opmode, Key key, AlgorithmParameters aParams, SecureRandom aRandom) throws InvalidKeyException, InvalidAlgorithmParameterException - Specified by:
engineInit
in classCipherSpi
- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
engineSetMode
- Specified by:
engineSetMode
in classCipherSpi
- Throws:
NoSuchAlgorithmException
-
engineSetPadding
- Specified by:
engineSetPadding
in classCipherSpi
- Throws:
NoSuchPaddingException
-
engineUpdate
protected byte[] engineUpdate(byte[] aInput, int aInputOffset, int aInputLength) - Specified by:
engineUpdate
in classCipherSpi
-
engineUpdate
protected int engineUpdate(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset) throws ShortBufferException - Specified by:
engineUpdate
in classCipherSpi
- Throws:
ShortBufferException
-
engineGetKeySize
- Overrides:
engineGetKeySize
in classCipherSpi
- Throws:
InvalidKeyException
-