Class 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)
      • Methods inherited from class javax.crypto.CipherSpi

        engineDoFinal, engineUnwrap, engineUpdate, engineUpdateAAD, engineUpdateAAD, engineWrap
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChaosCipherImpl

        public ChaosCipherImpl​()
    • Method Detail

      • engineDoFinal

        protected byte[] engineDoFinal​(byte[] aInput,
                                       int aInputOffset,
                                       int aInputLength)
                                throws javax.crypto.IllegalBlockSizeException,
                                       javax.crypto.BadPaddingException
        Specified by:
        engineDoFinal in class javax.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 class javax.crypto.CipherSpi
        Throws:
        javax.crypto.ShortBufferException
        javax.crypto.IllegalBlockSizeException
        javax.crypto.BadPaddingException
      • engineGetBlockSize

        protected int engineGetBlockSize​()
        Specified by:
        engineGetBlockSize in class javax.crypto.CipherSpi
      • engineGetIV

        protected byte[] engineGetIV​()
        Specified by:
        engineGetIV in class javax.crypto.CipherSpi
      • engineGetOutputSize

        protected int engineGetOutputSize​(int aInputLength)
        Specified by:
        engineGetOutputSize in class javax.crypto.CipherSpi
      • engineGetParameters

        protected java.security.AlgorithmParameters engineGetParameters​()
        Specified by:
        engineGetParameters in class javax.crypto.CipherSpi
      • engineInit

        protected void engineInit​(int aMode,
                                  java.security.Key aKey,
                                  java.security.SecureRandom aRandom)
                           throws java.security.InvalidKeyException
        Specified by:
        engineInit in class javax.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 class javax.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 class javax.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 class javax.crypto.CipherSpi
        Throws:
        java.security.NoSuchAlgorithmException
      • engineSetPadding

        protected void engineSetPadding​(java.lang.String aPading)
                                 throws javax.crypto.NoSuchPaddingException
        Specified by:
        engineSetPadding in class javax.crypto.CipherSpi
        Throws:
        javax.crypto.NoSuchPaddingException
      • engineUpdate

        protected byte[] engineUpdate​(byte[] aInput,
                                      int aInputOffset,
                                      int aInputLength)
        Specified by:
        engineUpdate in class javax.crypto.CipherSpi
      • engineUpdate

        protected int engineUpdate​(byte[] aInput,
                                   int aInputOffset,
                                   int aInputLength,
                                   byte[] aOutput,
                                   int aOutputOffset)
                            throws javax.crypto.ShortBufferException
        Specified by:
        engineUpdate in class javax.crypto.CipherSpi
        Throws:
        javax.crypto.ShortBufferException
      • engineGetKeySize

        protected int engineGetKeySize​(java.security.Key key)
                                throws java.security.InvalidKeyException
        Overrides:
        engineGetKeySize in class javax.crypto.CipherSpi
        Throws:
        java.security.InvalidKeyException