private void createEncryptionKey(String[] params) throws Exception {
    CommandLine args = parseCommandArgs(CREATE_KEY_OPTIONS, params);

    String keyName = args.getOptionValue("keyName");
    String bitLength = args.getOptionValue("bitLength", Integer.toString(DEFAULT_BIT_LENGTH));

    try {
      encryptionShim.createKey(keyName, Integer.parseInt(bitLength));
    } catch (Exception e) {
      throw new Exception("Cannot create encryption key: " + e.getMessage());
    }

    writeTestOutput("Encryption key created: '" + keyName + "'");
  }
Creates an encryption key using the parameters passed through the 'create_key' action.

@param params Parameters passed to the 'create_key' command action.
@throws Exception If key creation failed.
ql/src/java/org/apache/hadoop/hive/ql/processors/CryptoProcessor.java