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;
36 var request = new IdentityRequest (main_window,
40 request.set_callback ((IdentityRequest) => get_identity.callback());
48 var id_card = request.id_card;
50 if (id_card != null) {
51 foreach (string id_card_service in id_card.services)
53 if (id_card_service == service)
59 nai_out = id_card.nai;
60 password_out = id_card.password;
61 certificate_out = "certificate";