01: package org.bouncycastle.crypto.params;
02:
03: import org.bouncycastle.crypto.CipherParameters;
04:
05: public class AEADParameters implements CipherParameters {
06: private byte[] associatedText;
07: private byte[] nonce;
08: private KeyParameter key;
09: private int macSize;
10:
11: /**
12: * Base constructor.
13: *
14: * @param key key to be used by underlying cipher
15: * @param macSize macSize in bits
16: * @param nonce nonce to be used
17: * @param associatedText associated text, if any
18: */
19: public AEADParameters(KeyParameter key, int macSize, byte[] nonce,
20: byte[] associatedText) {
21: this .key = key;
22: this .nonce = nonce;
23: this .macSize = macSize;
24: this .associatedText = associatedText;
25: }
26:
27: public KeyParameter getKey() {
28: return key;
29: }
30:
31: public int getMacSize() {
32: return macSize;
33: }
34:
35: public byte[] getAssociatedText() {
36: return associatedText;
37: }
38:
39: public byte[] getNonce() {
40: return nonce;
41: }
42: }
|