Class GcmCipher

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  GcmCipher.CounterGCMParameterSpec
      Algorithm parameters for AES/GCM that assumes the IV uses an 8-byte counter field as its most significant bytes.
      • Nested classes/interfaces inherited from interface net.schmizz.sshj.transport.cipher.Cipher

        Cipher.Mode
    • Constructor Summary

      Constructors 
      Constructor Description
      GcmCipher​(int ivsize, int authSize, int bsize, java.lang.String algorithm, java.lang.String transformation)  
    • Constructor Detail

      • GcmCipher

        public GcmCipher​(int ivsize,
                         int authSize,
                         int bsize,
                         java.lang.String algorithm,
                         java.lang.String transformation)
    • Method Detail

      • getInitializedCipherInstance

        protected javax.crypto.Cipher getInitializedCipherInstance()
                                                            throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • initCipher

        protected void initCipher​(javax.crypto.Cipher cipher,
                                  Cipher.Mode mode,
                                  byte[] key,
                                  byte[] iv)
                           throws java.security.InvalidKeyException,
                                  java.security.InvalidAlgorithmParameterException
        Specified by:
        initCipher in class BaseCipher
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • updateAAD

        public void updateAAD​(byte[] data,
                              int offset,
                              int length)
        Description copied from interface: Cipher
        Adds the provided input data as additional authenticated data during encryption or decryption.
        Specified by:
        updateAAD in interface Cipher
        Overrides:
        updateAAD in class BaseCipher
        Parameters:
        data - The additional data to authenticate
        offset - The offset of the additional data in the buffer
        length - The number of bytes in the buffer to use for authentication
      • update

        public void update​(byte[] input,
                           int inputOffset,
                           int inputLen)
        Description copied from interface: Cipher
        Performs in-place encryption or decryption on the given data.
        Specified by:
        update in interface Cipher
        Overrides:
        update in class BaseCipher
        Parameters:
        input - the subject
        inputOffset - offset at which to start
        inputLen - number of bytes starting at inputOffset