Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

GCMParameterSpec

extends Object
implements AlgorithmParameterSpec
java.lang.Object
   ↳ javax.crypto.spec.GCMParameterSpec

Class Overview

Provides a the parameters for an instance of a Cipher using Galois/Counter Mode (GCM). This is an Authenticated Encryption with Associated Data (AEAD) mode for a cipher which allows you to use the updateAAD(byte[]) method to provide data that is transmitted in the clear but authenticated using a cryptographic Message Authentication Code (MAC).

Summary

Public Constructors
GCMParameterSpec (int tagLen, byte[] iv)
Creates a new GCMParameterSpec instance from the specified Initial Vector (IV) from buffer iv and a tag length of tagLen in bits.
GCMParameterSpec (int tagLen, byte[] iv, int offset, int byteCount)
Creates a new GCMParameterSpec instance with the Initial Vector (IV) of byteCount bytes from the specified buffer iv starting at offset and a tag length of tagLen in bits.
Public Methods
byte[] getIV ()
Returns the Initial Vector (IV) used by this parameter spec.
int getTLen ()
Returns the size of the tag in bits.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GCMParameterSpec (int tagLen, byte[] iv)

Creates a new GCMParameterSpec instance from the specified Initial Vector (IV) from buffer iv and a tag length of tagLen in bits.

Throws
IllegalArgumentException if the specified iv is null or offset and byteCount do not specify a valid chunk in the specified buffer.

public GCMParameterSpec (int tagLen, byte[] iv, int offset, int byteCount)

Creates a new GCMParameterSpec instance with the Initial Vector (IV) of byteCount bytes from the specified buffer iv starting at offset and a tag length of tagLen in bits.

Throws
IllegalArgumentException if the specified iv is null or offset and byteCount do not specify a valid chunk in the specified buffer.
ArrayIndexOutOfBoundsException if offset or byteCount are negative.

Public Methods

public byte[] getIV ()

Returns the Initial Vector (IV) used by this parameter spec.

public int getTLen ()

Returns the size of the tag in bits.