Skip to content

Most visited

Recently visited

navigation
Added in API level 19

GCMParameterSpec

public class GCMParameterSpec
extends Object implements AlgorithmParameterSpec

java.lang.Object
   ↳ javax.crypto.spec.GCMParameterSpec


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.

Inherited methods

From class java.lang.Object

Public constructors

GCMParameterSpec

Added in API level 19
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.

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

GCMParameterSpec

Added in API level 19
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.

Parameters
tagLen int
iv byte
offset int
byteCount int
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

getIV

Added in API level 19
byte[] getIV ()

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

Returns
byte[]

getTLen

Added in API level 19
int getTLen ()

Returns the size of the tag in bits.

Returns
int
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.