1 package iaik.pkcs.pkcs11.parameters;
2 
3 import iaik.pkcs.pkcs11.wrapper.CK_AES_CBC_ENCRYPT_DATA_PARAMS;
4 
5 /**
6  * This class encapsulates parameters for the algorithm
7  * Mechanism.AES_CBC_ENCRYPT_DATA.
8  *
9  * @author Karl Scheibelhofer
10  * @version 1.0
11  * @invariants
12  */
13 public class AesCbcEncryptDataParameters extends CbcEncryptDataParameters {
14 
15 	/**
16 	 * Create a new AesCbcEncryptDataParameters object with the given IV and
17 	 * data.
18 	 *
19 	 * @param iv The initialization vector.
20 	 * @param data The key derivation data.
21 	 * @preconditions (iv <> null) (iv.length == 16)
22 	 *                and (data <> null) and (data.length%16 == 0)
23 	 * @postconditions
24 	 */
AesCbcEncryptDataParameters(byte[] iv, byte[] data)25 	public AesCbcEncryptDataParameters(byte[] iv, byte[] data) {
26 		super(16, iv, data);
27 	}
28 
29 	/**
30 	 * Get this parameters object as Long object.
31 	 *
32 	 * @return This object as Long object.
33 	 * @preconditions
34 	 * @postconditions (result <> null)
35 	 */
getPKCS11ParamsObject()36 	public Object getPKCS11ParamsObject() {
37 		CK_AES_CBC_ENCRYPT_DATA_PARAMS params = new CK_AES_CBC_ENCRYPT_DATA_PARAMS();
38 
39 		params.iv = iv_;
40 		params.pData = data_;
41 
42 		return params;
43 	}
44 
45 }
46