This IOCTL command allows set the data key only for application-managed encryption. The data structure that is used for this IOCTL is for all of the supported operating systems.
struct data_key
    uchar[12 data_key_index; 
    uchar data_key_index_length;
    uchar[15] reserved1;     
    uchar[32] data_key;     
    uchar[48] reserved2;     
An example of the SET_DATA_KEY command is
int set_datakey(void)
   int rc = 0;
   struct data_key encryption_data_key_t;

   printf("Issuing set encryption data key......\n");
   memset(&encryption_data_key_t, 0, sizeof(struct data_key));
   /* fill in your data key here, then issue the following ioctl*/
   rc = ioctl(fd, SET_DATA_KEY, &encryption_data_key_t);
   return rc;