1 [DBus (name = "org.janet.Moonshot")]
2 public class MoonshotServer : Object {
4 private MainWindow main_window;
6 public MoonshotServer (Gtk.Window window)
8 this.main_window = (MainWindow) window;
12 * This is the function used by the GSS mechanism to get the NAI,
13 * password and certificate of the ID card for the specificated service.
15 * The function will block until the user choose the ID card.
17 * @param nai NAI of the ID Card (optional)
18 * @param password Password of the ID Card (optional)
19 * @param service Service application request an ID Card for
20 * @param nai_out NAI stored in the ID Card
21 * @param password_out Password stored in the ID Card
22 * @param certificate Certificate stored in th ID Card
24 * @return true if the user choose a correct ID card for that service,
27 public async bool get_identity (string nai,
31 out string password_out,
32 out string certificate_out)
34 bool has_service = false;
40 main_window.set_callback (get_identity.callback);
43 var id_card = this.main_window.selected_id_card_widget.id_card;
45 foreach (string id_card_service in id_card.services)
47 if (id_card_service == service)
53 nai_out = id_card.nai;
54 password_out = id_card.password;
55 certificate_out = "certificate";