/** * 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. */ 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, new Integer(bitLength)); } catch (Exception e) { throw new Exception("Cannot create encryption key: " + e.getMessage()); } writeTestOutput("Encryption key created: '" + keyName + "'"); }
/** * Deletes an encryption key using the parameters passed through the 'delete_key' action. * * @param params Parameters passed to the 'delete_key' command action. * @throws Exception If key deletion failed. */ private void deleteEncryptionKey(String[] params) throws Exception { CommandLine args = parseCommandArgs(DELETE_KEY_OPTIONS, params); String keyName = args.getOptionValue("keyName"); try { encryptionShim.deleteKey(keyName); } catch (IOException e) { throw new Exception("Cannot delete encryption key: " + e.getMessage()); } writeTestOutput("Encryption key deleted: '" + keyName + "'"); }
/** * Creates an encryption zone using the parameters passed through the 'create_zone' action. * * @param params Parameters passed to the 'create_zone' command action. * @throws Exception If zone creation failed. */ private void createEncryptionZone(String[] params) throws Exception { CommandLine args = parseCommandArgs(CREATE_ZONE_OPTIONS, params); String keyName = args.getOptionValue("keyName"); Path cryptoZone = new Path(args.getOptionValue("path")); if (cryptoZone == null) { throw new Exception("Cannot create encryption zone: Invalid path '" + args.getOptionValue("path") + "'"); } try { encryptionShim.createEncryptionZone(cryptoZone, keyName); } catch (IOException e) { throw new Exception("Cannot create encryption zone: " + e.getMessage()); } writeTestOutput("Encryption zone created: '" + cryptoZone + "' using key: '" + 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. */ 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, new Integer(bitLength)); } catch (Exception e) { throw new Exception("Cannot create encryption key: " + e.getMessage()); } writeTestOutput("Encryption key created: '" + keyName + "'"); }
/** * Creates an encryption zone using the parameters passed through the 'create_zone' action. * * @param params Parameters passed to the 'create_zone' command action. * @throws Exception If zone creation failed. */ private void createEncryptionZone(String[] params) throws Exception { CommandLine args = parseCommandArgs(CREATE_ZONE_OPTIONS, params); String keyName = args.getOptionValue("keyName"); Path cryptoZone = new Path(args.getOptionValue("path")); if (cryptoZone == null) { throw new Exception("Cannot create encryption zone: Invalid path '" + args.getOptionValue("path") + "'"); } try { encryptionShim.createEncryptionZone(cryptoZone, keyName); } catch (IOException e) { throw new Exception("Cannot create encryption zone: " + e.getMessage()); } writeTestOutput("Encryption zone created: '" + cryptoZone + "' using key: '" + keyName + "'"); }
/** * Deletes an encryption key using the parameters passed through the 'delete_key' action. * * @param params Parameters passed to the 'delete_key' command action. * @throws Exception If key deletion failed. */ private void deleteEncryptionKey(String[] params) throws Exception { CommandLine args = parseCommandArgs(DELETE_KEY_OPTIONS, params); String keyName = args.getOptionValue("keyName"); try { encryptionShim.deleteKey(keyName); } catch (IOException e) { throw new Exception("Cannot delete encryption key: " + e.getMessage()); } writeTestOutput("Encryption key deleted: '" + 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. */ 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, new Integer(bitLength)); } catch (Exception e) { throw new Exception("Cannot create encryption key: " + e.getMessage()); } writeTestOutput("Encryption key created: '" + keyName + "'"); }
/** * Deletes an encryption key using the parameters passed through the 'delete_key' action. * * @param params Parameters passed to the 'delete_key' command action. * @throws Exception If key deletion failed. */ private void deleteEncryptionKey(String[] params) throws Exception { CommandLine args = parseCommandArgs(DELETE_KEY_OPTIONS, params); String keyName = args.getOptionValue("keyName"); try { encryptionShim.deleteKey(keyName); } catch (IOException e) { throw new Exception("Cannot delete encryption key: " + e.getMessage()); } writeTestOutput("Encryption key deleted: '" + keyName + "'"); } }
/** * Creates an encryption zone using the parameters passed through the 'create_zone' action. * * @param params Parameters passed to the 'create_zone' command action. * @throws Exception If zone creation failed. */ private void createEncryptionZone(String[] params) throws Exception { CommandLine args = parseCommandArgs(CREATE_ZONE_OPTIONS, params); String keyName = args.getOptionValue("keyName"); Path cryptoZone = new Path(args.getOptionValue("path")); if (cryptoZone == null) { throw new Exception("Cannot create encryption zone: Invalid path '" + args.getOptionValue("path") + "'"); } try { encryptionShim.createEncryptionZone(cryptoZone, keyName); } catch (IOException e) { throw new Exception("Cannot create encryption zone: " + e.getMessage()); } writeTestOutput("Encryption zone created: '" + cryptoZone + "' using key: '" + keyName + "'"); }