Package javax.crypto.spec
Class GCMParameterSpec
- java.lang.Object
-
- javax.crypto.spec.GCMParameterSpec
-
- All Implemented Interfaces:
AlgorithmParameterSpec
public class GCMParameterSpec extends Object implements AlgorithmParameterSpec
Provides a the parameters for an instance of aCipherusing Galois/Counter Mode (GCM). This is an Authenticated Encryption with Associated Data (AEAD) mode for a cipher which allows you to use theCipher.updateAAD(byte[])method to provide data that is transmitted in the clear but authenticated using a cryptographic Message Authentication Code (MAC).- Since:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description GCMParameterSpec(int tagLen, byte[] iv)Creates a newGCMParameterSpecinstance from the specified Initial Vector (IV) from bufferivand a tag length oftagLenin bits.GCMParameterSpec(int tagLen, byte[] iv, int offset, int byteCount)Creates a newGCMParameterSpecinstance with the Initial Vector (IV) ofbyteCountbytes from the specified bufferivstarting atoffsetand a tag length oftagLenin bits.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getIV()Returns the Initial Vector (IV) used by this parameter spec.intgetTLen()Returns the size of the tag in bits.
-
-
-
Constructor Detail
-
GCMParameterSpec
public GCMParameterSpec(int tagLen, byte[] iv)Creates a newGCMParameterSpecinstance from the specified Initial Vector (IV) from bufferivand a tag length oftagLenin bits.- Throws:
IllegalArgumentException- if the specifiedivis null oroffsetandbyteCountdo not specify a valid chunk in the specified buffer.
-
GCMParameterSpec
public GCMParameterSpec(int tagLen, byte[] iv, int offset, int byteCount)Creates a newGCMParameterSpecinstance with the Initial Vector (IV) ofbyteCountbytes from the specified bufferivstarting atoffsetand a tag length oftagLenin bits.- Throws:
IllegalArgumentException- if the specifiedivis null oroffsetandbyteCountdo not specify a valid chunk in the specified buffer.ArrayIndexOutOfBoundsException- ifoffsetorbyteCountare negative.
-
-