Top Description Fields Constructors Methods
org.bouncycastle.jcajce.spec

public Class AEADParameterSpec

extends IvParameterSpec
Class Inheritance
Imports
javax.crypto.spec.IvParameterSpec, org.bouncycastle.util.Arrays

ParameterSpec for AEAD modes which allows associated data to be added via an algorithm parameter spec.In normal circumstances you would only want to use this if you had to work with the pre-JDK1.7 Cipher class as associated data is ignored for the purposes of returning a Cipher's parameters.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final int

Constructor Summary

AccessConstructor and Description
public
AEADParameterSpec(byte[]
nonce/iv to be used
nonce
,
int
macSize in bits
macSizeInBits
)

Base constructor.

public
AEADParameterSpec(byte[]
nonce/iv to be used
nonce
,
int
macSize in bits
macSizeInBits
,
byte[]
associated data to be prepended to the cipher stream.
associatedData
)

Base constructor with prepended associated data.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the associated data, null if there isn't any.
getAssociatedData
()

Return the associated data associated with this parameter spec.

public int

Returns:

the MAC size in bits.
getMacSizeInBits
()

Return the size of the MAC associated with this parameter spec.

public byte[]

Returns:

the nonce/IV.
getNonce
()

Return the nonce (same as IV) associated with this parameter spec.

Inherited from javax.crypto.spec.IvParameterSpec:
getIV

Field Detail

associatedDataback to summary
private final byte[] associatedData
macSizeInBitsback to summary
private final int macSizeInBits

Constructor Detail

AEADParameterSpecback to summary
public AEADParameterSpec(byte[] nonce, int macSizeInBits)

Base constructor.

Parameters
nonce:byte[]

nonce/iv to be used

macSizeInBits:int

macSize in bits

AEADParameterSpecback to summary
public AEADParameterSpec(byte[] nonce, int macSizeInBits, byte[] associatedData)

Base constructor with prepended associated data.

Parameters
nonce:byte[]

nonce/iv to be used

macSizeInBits:int

macSize in bits

associatedData:byte[]

associated data to be prepended to the cipher stream.

Method Detail

getAssociatedDataback to summary
public byte[] getAssociatedData()

Return the associated data associated with this parameter spec.

Returns:byte[]

the associated data, null if there isn't any.

getMacSizeInBitsback to summary
public int getMacSizeInBits()

Return the size of the MAC associated with this parameter spec.

Returns:int

the MAC size in bits.

getNonceback to summary
public byte[] getNonce()

Return the nonce (same as IV) associated with this parameter spec.

Returns:byte[]

the nonce/IV.