private static void startSession() {
    Session session = Session.getInstance(true);

    Pair<BigInteger, BigInteger> privateKeys = session.getPrivateKey();

    System.out.println("");
    System.out.println("Private key x: " + privateKeys.getFirst());
    System.out.println("Private key y: " + privateKeys.getSecond());
    System.out.println("");

    System.out.println("Please introduce message to sign:");
    String text = null;
    while (text == null) {
      try {
        text = (new BufferedReader(new InputStreamReader(System.in))).readLine();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
    Pair<BigInteger, BigInteger> signature =
        DSA.sign(
            true,
            text,
            session.getGlobalKeyG(),
            session.getGlobalKeyP(),
            session.getGlobalKeyQ(),
            privateKeys.getFirst());
    System.out.println(
        "Signature (r,s): (" + signature.getFirst() + ", " + signature.getSecond() + ")");
    System.out.println("");
    System.out.println("Do you want to verify a message?");
    System.out.println("  1.Yes (y)");
    System.out.println("  2.No (press enter)");
    String alg = null;
    try {
      alg = (new BufferedReader(new InputStreamReader(System.in))).readLine();
    } catch (IOException e) {
      e.printStackTrace();
    }

    switch (alg) {
      case "y":
        verifyMessage();
        break;
      default:
        System.out.println("Bye!");
        System.exit(1);
        break;
    }
  }
  /**
   * metodo che stampa la classifica su pdf
   *
   * @param ranks lista di coppie (squadra, punteggio)
   * @param isConcluse flag vero se la classifica � definitiva
   * @param doc documento pdf su cui stampare
   * @throws DocumentException sollevata quando si verificano errori di stampa su pdf
   */
  private void printRanking(List<Pair<TeamEntity, Integer>> ranks, Boolean isConcluse, Document doc)
      throws DocumentException {
    // tabella pdf, 3 colonne
    PdfPTable table = new PdfPTable(3);
    // cella
    PdfPCell cell;
    // aggiungi le celle di intestazione
    table.setHeaderRows(1);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100);
    table.setWidths(new float[] {0.2f, 1, 0.2f});
    table.addCell("Posizione");
    table.addCell("Squadra");
    table.addCell("Punteggio");

    Integer position = 0;
    Integer oldPoints = Integer.MAX_VALUE;
    Integer newPoints;
    for (Iterator<Pair<TeamEntity, Integer>> it = ranks.iterator(); it.hasNext(); ) {
      Pair<TeamEntity, Integer> coppia = it.next();
      newPoints = coppia.getSecond();
      // se non � un parimerito avanza di posizione
      if (newPoints < oldPoints) {
        oldPoints = newPoints;
        position++;
      }
      // stampa la posizione
      table.addCell(position.toString());
      // stampa il nome della squadra
      cell = new PdfPCell(new Phrase(coppia.getFirst().getName()));
      cell.setHorizontalAlignment(Element.ALIGN_LEFT);
      table.addCell(cell);
      // stampa il punteggio
      table.addCell(newPoints.toString());
    }

    // aggiungi il titolo al pdf
    doc.add(
        new Phrase(
            new Chunk(
                "\nClassifica " + (isConcluse ? "definitiva" : "provvisoria"),
                FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD))));
    // aggiungi la tabella al pdf
    doc.add(table);
  }