Update to latest master
[moonshot-ui.git] / src / msrpc-client.vala
1 using Rpc;
2 using MoonshotRpcInterface;
3
4 void main () {
5     Rpc.client_bind (ref MoonshotRpcInterface.binding_handle, "/org/janet/Moonshot");
6
7     char *nai_out = null;
8     char *password_out = null;
9     char *certificate_out = null;
10     bool result = false;
11
12     Rpc.AsyncCall call = Rpc.AsyncCall();
13     get_identity (call, "username@issuer", "pass", "service", &nai_out, &password_out, &certificate_out);
14     result = call.complete_bool ();
15
16     if (result == false)
17         error ("The nai, password or service does not match the selected identity\n");
18     else
19         stdout.printf ("%s %s %s\n", (string)nai_out, (string)password_out, (string)certificate_out);
20
21     delete nai_out;
22     delete password_out;
23     delete certificate_out;
24
25     Rpc.client_unbind (ref MoonshotRpcInterface.binding_handle);
26 }
27