class EncryptCommand extends AbstractBaseCommand {

    @Override
    int execute(OptionsAndArgs pOpts, Object pVm, VirtualMachineHandler pHandler)
            throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
        try {
            List<String> args = pOpts.getExtraArgs();
            String password = args.size() == 0 ?
                    getPasswordFromConsoleOrStdin(pOpts) :
                    args.get(0);
            JolokiaCipher jolokiaCipher = keyHolder != null ?
                    new JolokiaCipher(keyHolder) :
                    new JolokiaCipher();
            String encrypted = jolokiaCipher.encrypt(password);
            System.out.printf("[[%s]]%n", encrypted);
            return 0;
        } catch (GeneralSecurityException exp) {
            throw new InvocationTargetException(exp,"Can not encrypt password");
        }
    }

    public  EncryptCommand();
    public  EncryptCommand(JolokiaCipher.KeyHolder pKeyHolder);

}