org.bouncycastle.crypto.internal.params.AEADParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bc-fips Show documentation
Show all versions of bc-fips Show documentation
The FIPS 140-3 Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms certified to FIPS 140-3 level 1. This jar contains JCE provider and low-level API for the BC-FJA version 2.0.0, FIPS Certificate #4743. Please see certificate for certified platform details.
/***************************************************************
* DO NOT EDIT THIS CLASS bc-java SOURCE FILE
/****** DO NOT EDIT THIS CLASS bc-java SOURCE FILE ******/
/***************************************************************/
package org.bouncycastle.crypto.internal.params;
import org.bouncycastle.crypto.internal.CipherParameters;
public class AEADParameters
implements CipherParameters
{
private final byte[] associatedText;
private final byte[] nonce;
private final KeyParameter key;
private final int macSize;
/**
* Base constructor.
*
* @param key key to be used by underlying cipher
* @param macSize macSize in bits
* @param nonce nonce to be used
*/
public AEADParameters(KeyParameter key, int macSize, byte[] nonce)
{
this(key, macSize, nonce, null);
}
/**
* Base constructor.
*
* @param key key to be used by underlying cipher
* @param macSize macSize in bits
* @param nonce nonce to be used
* @param associatedText initial associated text, if any
*/
public AEADParameters(KeyParameter key, int macSize, byte[] nonce, byte[] associatedText)
{
this.key = key;
this.nonce = nonce;
this.macSize = macSize;
this.associatedText = associatedText;
}
public KeyParameter getKey()
{
return key;
}
public int getMacSize()
{
return macSize;
}
public byte[] getAssociatedText()
{
return associatedText;
}
public byte[] getNonce()
{
return nonce;
}
}