private void jButtonCreateUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCreateUserActionPerformed
        try {
            // On vérifie que le user est unique

            ArrayList<User> users = DataBase.getInstance().getUsers();

            boolean ok = true;
            for (int i = 0; i < users.size(); i++) {
                if (users.get(i).getLogin().equals(this.jTextFieldLogin.getText())) {
                    ok = false;
                }
            }

            if (ok) {

                User user = new User();
                user.setLogin(this.jTextFieldLogin.getText());
                user.setPassword(DataBase.hashPassword(new String(this.jPasswordField.getPassword())));

                // On génère les clés
                Keys keys = new Keys();
                keys.generation();
                user.setKeys(keys);

                // On donne au user une liste de fichier vide
                user.setFiles(new ArrayList<SignatureFile>());

                // On ajoute le user à la liste
                users.add(user);

                // On sauvegarde la database
                DataBase.getInstance().save();



                javax.swing.JOptionPane.showMessageDialog(this.parent, "User sucessfully created.");
            } else {
                javax.swing.JOptionPane.showMessageDialog(this.parent, "This user already exists.");
            }

        } catch (Exception ex) {
            Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);
        }



    }//GEN-LAST:event_jButtonCreateUserActionPerformed