com.ibm.crypto.fips.provider

Class AESGCMCipher

  • java.lang.Object
    • javax.crypto.CipherSpi
      • com.ibm.crypto.fips.provider.AESGCMCipher
  • All Implemented Interfaces:
    AESConstants, GCMConstants


    public final class AESGCMCipher
    extends javax.crypto.CipherSpi
    implements AESConstants, GCMConstants
    This is an implementation of AES GCM mode, which does not currently support Cipher.update.
    • Constructor Detail

      • AESGCMCipher

        public AESGCMCipher()
        Constructs a new AESGCMCipher instance.
    • Method Detail

      • engineDoFinal

        protected byte[] engineDoFinal(byte[] input,
                           int inputOffset,
                           int inputLen)
                                throws javax.crypto.IllegalBlockSizeException,
                                       javax.crypto.BadPaddingException
        Specified by:
        engineDoFinal in class javax.crypto.CipherSpi
        Throws:
        javax.crypto.IllegalBlockSizeException
        javax.crypto.BadPaddingException
      • internalDoFinal

        protected byte[] internalDoFinal(byte[] input,
                             int inputOffset,
                             int inputLen)
                                  throws javax.crypto.IllegalBlockSizeException,
                                         javax.crypto.BadPaddingException
        Throws:
        javax.crypto.IllegalBlockSizeException
        javax.crypto.BadPaddingException
      • engineDoFinal

        protected int engineDoFinal(byte[] input,
                        int inputOffset,
                        int inputLen,
                        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
      • internalDoFinal

        protected int internalDoFinal(byte[] input,
                          int inputOffset,
                          int inputLen,
                          byte[] output,
                          int outputOffset)
                               throws javax.crypto.ShortBufferException,
                                      javax.crypto.IllegalBlockSizeException,
                                      javax.crypto.BadPaddingException,
                                      java.lang.IllegalStateException
        Throws:
        javax.crypto.ShortBufferException
        javax.crypto.IllegalBlockSizeException
        javax.crypto.BadPaddingException
        java.lang.IllegalStateException
      • engineGetBlockSize

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

        protected int internalGetBlockSize()
      • engineGetIV

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

        protected byte[] internalGetIV()
      • engineGetOutputSize

        protected int engineGetOutputSize(int inputLen)
        Specified by:
        engineGetOutputSize in class javax.crypto.CipherSpi
      • internalGetOutputSize

        protected int internalGetOutputSize(int inputLen)
      • engineGetParameters

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

        protected java.security.AlgorithmParameters internalGetParameters()
      • engineInit

        protected void engineInit(int opmode,
                      java.security.Key key,
                      java.security.SecureRandom random)
                           throws java.security.InvalidKeyException
        Specified by:
        engineInit in class javax.crypto.CipherSpi
        Throws:
        java.security.InvalidKeyException
      • internalInit

        protected void internalInit(int opmode,
                        java.security.Key key,
                        java.security.SecureRandom random)
                             throws java.security.InvalidKeyException,
                                    java.lang.IllegalStateException
        Throws:
        java.security.InvalidKeyException
        java.lang.IllegalStateException
      • engineInit

        protected void engineInit(int opmode,
                      java.security.Key key,
                      java.security.spec.AlgorithmParameterSpec params,
                      java.security.SecureRandom random)
                           throws java.security.InvalidKeyException,
                                  java.security.InvalidAlgorithmParameterException
        Specified by:
        engineInit in class javax.crypto.CipherSpi
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • internalInit

        protected void internalInit(int opmode,
                        java.security.Key key,
                        java.security.spec.AlgorithmParameterSpec params,
                        java.security.SecureRandom random)
                             throws java.security.InvalidKeyException,
                                    java.security.InvalidAlgorithmParameterException
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • engineInit

        protected void engineInit(int opmode,
                      java.security.Key key,
                      java.security.AlgorithmParameters params,
                      java.security.SecureRandom random)
                           throws java.security.InvalidKeyException,
                                  java.security.InvalidAlgorithmParameterException
        Specified by:
        engineInit in class javax.crypto.CipherSpi
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • internalInit

        protected void internalInit(int opmode,
                        java.security.Key key,
                        java.security.AlgorithmParameters params,
                        java.security.SecureRandom random)
                             throws java.security.InvalidKeyException,
                                    java.security.InvalidAlgorithmParameterException
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • engineSetMode

        protected void engineSetMode(java.lang.String mode)
                              throws java.security.NoSuchAlgorithmException
        Specified by:
        engineSetMode in class javax.crypto.CipherSpi
        Throws:
        java.security.NoSuchAlgorithmException
      • internalSetMode

        protected void internalSetMode(java.lang.String mode)
                                throws java.security.NoSuchAlgorithmException
        Throws:
        java.security.NoSuchAlgorithmException
      • engineSetPadding

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

        protected void internalSetPadding(java.lang.String padding)
                                   throws javax.crypto.NoSuchPaddingException
        Throws:
        javax.crypto.NoSuchPaddingException
      • engineUpdate

        protected byte[] engineUpdate(byte[] input,
                          int inputOffset,
                          int inputLen)
        Specified by:
        engineUpdate in class javax.crypto.CipherSpi
      • internalUpdate

        protected byte[] internalUpdate(byte[] input,
                            int inputOffset,
                            int inputLen)
      • engineUpdate

        protected int engineUpdate(byte[] input,
                       int inputOffset,
                       int inputLen,
                       byte[] output,
                       int outputOffset)
                            throws javax.crypto.ShortBufferException
        Specified by:
        engineUpdate in class javax.crypto.CipherSpi
        Throws:
        javax.crypto.ShortBufferException
      • internalUpdate

        protected int internalUpdate(byte[] input,
                         int inputOffset,
                         int inputLen,
                         byte[] output,
                         int outputOffset)
                              throws javax.crypto.ShortBufferException
        Throws:
        javax.crypto.ShortBufferException
      • engineUpdateAAD

        protected void engineUpdateAAD(byte[] src,
                           int offset,
                           int len)
        Overrides:
        engineUpdateAAD in class javax.crypto.CipherSpi
      • internalUpdateAAD

        protected void internalUpdateAAD(byte[] src,
                             int offset,
                             int len)
      • engineUpdateAAD

        protected void engineUpdateAAD(java.nio.ByteBuffer src)
        Overrides:
        engineUpdateAAD in class javax.crypto.CipherSpi
      • internalUpdateAAD

        protected void internalUpdateAAD(java.nio.ByteBuffer src)
      • engineGetKeySize

        protected int engineGetKeySize(java.security.Key key)
                                throws java.security.InvalidKeyException
        Returns the key size of the given key object.
        Overrides:
        engineGetKeySize in class javax.crypto.CipherSpi
        Parameters:
        key - the key object.
        Returns:
        the key size of the given key object.
        Throws:
        java.security.InvalidKeyException - if key is invalid.
      • internalGetKeySize

        protected int internalGetKeySize(java.security.Key key)
                                  throws java.security.InvalidKeyException
        Throws:
        java.security.InvalidKeyException
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.