Package org.refcodes.security.ext.chaos
Class ChaosCipherImpl
- java.lang.Object
-
- javax.crypto.CipherSpi
-
- org.refcodes.security.ext.chaos.ChaosCipherImpl
-
public class ChaosCipherImpl extends javax.crypto.CipherSpi
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
Constructors Constructor Description ChaosCipherImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
engineDoFinal(byte[] aInput, int aInputOffset, int aInputLength)
protected int
engineDoFinal(byte[] aInput, int aInputOffset, int aInputLength, byte[] output, int outputOffset)
protected int
engineGetBlockSize()
protected byte[]
engineGetIV()
protected int
engineGetKeySize(java.security.Key key)
protected int
engineGetOutputSize(int aInputLength)
protected java.security.AlgorithmParameters
engineGetParameters()
protected void
engineInit(int opmode, java.security.Key key, java.security.AlgorithmParameters aParams, java.security.SecureRandom aRandom)
protected void
engineInit(int aMode, java.security.Key aKey, java.security.SecureRandom aRandom)
protected void
engineInit(int opmode, java.security.Key key, java.security.spec.AlgorithmParameterSpec aParams, java.security.SecureRandom aRandom)
protected void
engineSetMode(java.lang.String aMode)
protected void
engineSetPadding(java.lang.String aPading)
protected byte[]
engineUpdate(byte[] aInput, int aInputOffset, int aInputLength)
protected int
engineUpdate(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset)
-
-
-
Method Detail
-
engineDoFinal
protected byte[] engineDoFinal(byte[] aInput, int aInputOffset, int aInputLength) throws javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException
- Specified by:
engineDoFinal
in classjavax.crypto.CipherSpi
- Throws:
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
-
engineDoFinal
protected int engineDoFinal(byte[] aInput, int aInputOffset, int aInputLength, byte[] output, int outputOffset) throws javax.crypto.ShortBufferException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException
- Specified by:
engineDoFinal
in classjavax.crypto.CipherSpi
- Throws:
javax.crypto.ShortBufferException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
-
engineGetBlockSize
protected int engineGetBlockSize()
- Specified by:
engineGetBlockSize
in classjavax.crypto.CipherSpi
-
engineGetIV
protected byte[] engineGetIV()
- Specified by:
engineGetIV
in classjavax.crypto.CipherSpi
-
engineGetOutputSize
protected int engineGetOutputSize(int aInputLength)
- Specified by:
engineGetOutputSize
in classjavax.crypto.CipherSpi
-
engineGetParameters
protected java.security.AlgorithmParameters engineGetParameters()
- Specified by:
engineGetParameters
in classjavax.crypto.CipherSpi
-
engineInit
protected void engineInit(int aMode, java.security.Key aKey, java.security.SecureRandom aRandom) throws java.security.InvalidKeyException
- Specified by:
engineInit
in classjavax.crypto.CipherSpi
- Throws:
java.security.InvalidKeyException
-
engineInit
protected void engineInit(int opmode, java.security.Key key, java.security.spec.AlgorithmParameterSpec aParams, java.security.SecureRandom aRandom) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
- Specified by:
engineInit
in classjavax.crypto.CipherSpi
- Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
-
engineInit
protected void engineInit(int opmode, java.security.Key key, java.security.AlgorithmParameters aParams, java.security.SecureRandom aRandom) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
- Specified by:
engineInit
in classjavax.crypto.CipherSpi
- Throws:
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
-
engineSetMode
protected void engineSetMode(java.lang.String aMode) throws java.security.NoSuchAlgorithmException
- Specified by:
engineSetMode
in classjavax.crypto.CipherSpi
- Throws:
java.security.NoSuchAlgorithmException
-
engineSetPadding
protected void engineSetPadding(java.lang.String aPading) throws javax.crypto.NoSuchPaddingException
- Specified by:
engineSetPadding
in classjavax.crypto.CipherSpi
- Throws:
javax.crypto.NoSuchPaddingException
-
engineUpdate
protected byte[] engineUpdate(byte[] aInput, int aInputOffset, int aInputLength)
- Specified by:
engineUpdate
in classjavax.crypto.CipherSpi
-
engineUpdate
protected int engineUpdate(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset) throws javax.crypto.ShortBufferException
- Specified by:
engineUpdate
in classjavax.crypto.CipherSpi
- Throws:
javax.crypto.ShortBufferException
-
engineGetKeySize
protected int engineGetKeySize(java.security.Key key) throws java.security.InvalidKeyException
- Overrides:
engineGetKeySize
in classjavax.crypto.CipherSpi
- Throws:
java.security.InvalidKeyException
-
-