Esempio n. 1
0
 public static void AddCommands(DispatchTable table)
 {
     table.Add("as_add", new Dispatch("Set parameters for a 'new' Authorization Server", "as_add_server <serverurl> <profile> <user key>", AddAuthServer));
     table.Add("as_list", new Dispatch("List active Authroization servers", "as_list", ListAuthServers));
     table.Add("as_use_profile", new Dispatch("Set the profile to use with the resource server", "as_use_profile <profile name>", SetProfile));
     table.Add("as_test", new Dispatch("RUn Dispatch Tests", "as_test <number>", AceTest.Test));
 }
Esempio n. 2
0
 public static void Register(DispatchTable table)
 {
     //  OSCORE Functions
     table.Add("add-oscore", new Dispatch("Add a OSCORE key to the key set", "add-oscore key-name key-value", AddOscoreKey));
     table.Add("add-group-oscore", new Dispatch("Add a Group OSCORE key to the key set", "add-oscore key-name key-value", AddGroupOscoreKey));
     table.Add("set-oscore", new Dispatch("Select an score key to use", "set-oscore [key-name]", UseOscoreKey));
     table.Add("use-oscore", new Dispatch("Select an score key to use", "use-oscore [key-name]", UseOscoreKey));
     table.Add("run-oscore-test", new Dispatch("Run a specific oscore text", "run-score-test testNumber", RunOscoreText));
     table.Add("set-oscore-piv", new Dispatch("Set the PIV value for the current oscore key", "set-oscore-piv pivNumber", SetOscorePiv));
     table.Add("gen-oscore", new Dispatch("Generate Group OSCORE parameters", "gen-oscore", GenOscore));
 }
Esempio n. 3
0
        static void FillDispatchTable(DispatchTable table)
        {
            table.Add("signal", new Dispatch("Send signal message to server",
                                             "Signal <Msg> <Uri>\nMsg is one of 'Ping', 'Pong', 'Release', 'Abort'",
                                             SendSignal));
            table.Add("get",
                      new Dispatch("Send GET method to server", "Get <uri> [<body>]", RunCoapCommand));
            table.Add("put",
                      new Dispatch("Send PUT method to server", "put <uri> [<body>]", RunCoapCommand));
            table.Add("delete",
                      new Dispatch("Send DELTE method to server", "delete <uri> [<body>]", RunCoapCommand));
            table.Add("post",
                      new Dispatch("Send POST method to server", "post <uri> [<body>]", RunCoapCommand));
            table.Add("fetch",
                      new Dispatch("Send FETCH method to server", "fetch <uri> [<body>]", RunCoapCommand));
            table.Add("patch",
                      new Dispatch("Send PATCH method to server", "patch <uri> [<body>]", RunCoapCommand));
            table.Add("ipatch",
                      new Dispatch("Send IPATCH method to server", "ipatch <uri> [<body>]", RunCoapCommand));
            table.Add("observe",
                      new Dispatch("Send OBSERVE method to server", "observe <uri> [<body>]", RunCoapCommand));
            table.Add("unobserve",
                      new Dispatch("Send UNOBSERVE method to server", "unobserve <uri> [<body>]", RunCoapCommand));
            table.Add("discover",
                      new Dispatch("Send DISCOVER method to server", "discover <uri> [<body>]", RunCoapCommand));
            table.Add("con", new Dispatch("Use CON or NON for messages", "con [YES|NO]", SetConState));
            table.Add("sleep", new Dispatch("Sleep for n seconds", "sleep <seconds>",
                                            m => Thread.Sleep(int.Parse(m[1]) * 1000)));

            table.Add("payload",
                      new Dispatch("Set the payload with CBOR diag value", "payload <cbor diag>", RunSetPayload));

            table.Add("host", new Dispatch("Set a default host to be used", "host [<uri>]", SetHost));
            table.Add("set-transport", new Dispatch("Set the transport to default to if not in the URL",
                                                    "set-transport UDP|TCP", SetTransport));
            table.Add("local", new Dispatch("Set the local address to send from", "local [<uri>]", SetLocal));

            table.Add("add-tlskey", new Dispatch("Add a named TLS key to the dictionary", "add-tlskey ????", AddTlsKey));
#if SUPPORT_TLS_CWT
            table.Add("add-tlscwt", new Dispatch("Add a named CWT for TLS to the dictionary", "add-tlscwt name CWT PrivateKey", AddTlsCwt));
#endif
            table.Add("add-tlscert", new Dispatch("Add a key plus certificate for TLS", "set-tslcert name X509Cert PrivateKey", AddTlsCert));
            table.Add("set-tlskey", new Dispatch("Set the default TLS key to use", "set-tlskey [key-name]", SetTlsKey));
            table.Add("add-cwtroot", new Dispatch("Add a key to the CWT trust store", "add-cwtroot key", AddCwtRoot));

            table.Add("etag", new Dispatch("Manipulate ETag behavior", "etag [None|clear|last|add|all]", ETagCommands));
            table.Add("if-match", new Dispatch("Set If-Match message options", "if-match [all|none|last]", IfMatchCommands));
        }
Esempio n. 4
0
 public static void AddCommands(DispatchTable table)
 {
     table.Add("as_add",
               new Dispatch("Set parameters for a 'new' Authorization Server",
                            "as_add_server <serverurl> <profile> <user key> [JSON] [<server key>]", AddAuthServer));
     table.Add("as_list", new Dispatch("List active Authroization servers", "as_list", ListAuthServers));
     table.Add("as_use_profile",
               new Dispatch("Set the profile to use with the resource server", "as_use_profile <profile name>",
                            SetProfile));
     table.Add("as_test", new Dispatch("RUn Dispatch Tests", "as_test <number>", AceTest.Test));
     table.Add("as_psk", new Dispatch("Send the token as the PSK", "as_psk [yes|no]", SetPskUsage));
     table.Add("as_use_scope",
               new Dispatch("Set the scope to be used", "as_use_scope h'XXXXX' or \"XXXXX\"", SetScope));
     table.Add("as_audience", new Dispatch("Set the audience value to use on request", "as_audience <string>", SetAudience));
     table.Add("as_user_key", new Dispatch("Set the user key to be sent as part of the AS request", "as_user_key <key name>", SetUserKey));
     table.Add("as_save_key", new Dispatch("Save the last key with a name", "as_save_key <key name>", SaveLastKey));
 }
Esempio n. 5
0
        static void FillDispatchTable(DispatchTable table)
        {
            table.Add("signal", new Dispatch("Send signal message to server",
                                             "Signal <Msg> <Uri>\nMsg is one of 'Ping', 'Pong', 'Release', 'Abort'",
                                             SendSignal));
            table.Add("get",
                      new Dispatch("Send GET method to server", "Get <uri> [<body>]", RunCoapCommand));
            table.Add("put",
                      new Dispatch("Send PUT method to server", "put <uri> [<body>]", RunCoapCommand));
            table.Add("delete",
                      new Dispatch("Send DELTE method to server", "delete <uri> [<body>]", RunCoapCommand));
            table.Add("post",
                      new Dispatch("Send POST method to server", "post <uri> [<body>]", RunCoapCommand));
            table.Add("fetch",
                      new Dispatch("Send FETCH method to server", "fetch <uri> [<body>]", RunCoapCommand));
            table.Add("patch",
                      new Dispatch("Send PATCH method to server", "patch <uri> [<body>]", RunCoapCommand));
            table.Add("ipatch",
                      new Dispatch("Send IPATCH method to server", "ipatch <uri> [<body>]", RunCoapCommand));
            table.Add("observe",
                      new Dispatch("Send OBSERVE method to server", "observe <uri> [<body>]", RunCoapCommand));
            table.Add("unobserve",
                      new Dispatch("Send UNOBSERVE method to server", "unobserve <uri> [<body>]", RunCoapCommand));
            table.Add("discover",
                      new Dispatch("Send DISCOVER method to server", "discover <uri> [<body>]", RunCoapCommand));
            table.Add("con", new Dispatch("Use CON or NON for messages", "con [YES|NO]", SetConState));
            table.Add("sleep", new Dispatch("Sleep for n seconds", "sleep <seconds>",
                                            m => Thread.Sleep(int.Parse(m[1]) * 1000)));

            table.Add("payload",
                      new Dispatch("Set the payload with CBOR diag value", "payload <cbor diag>", RunSetPayload));

            table.Add("host", new Dispatch("Set a default host to be used", "host [<uri>]", SetHost));
            table.Add("set-transport", new Dispatch("Set the transport to default to if not in the URL",
                                                    "set-transport UDP|TCP", SetTransport));

            table.Add("add-tlskey", new Dispatch("Add a named TLS key to the dictionary", "add-tlskey ????", AddTlsKey));
            table.Add("set-tlskey", new Dispatch("Set the default TLS key to use", "set-tlskey [key-name]", SetTlsKey));
        }
 public static void AddCommands(DispatchTable table)
 {
     table.Add("rd_test", new Dispatch("Run my internal Resource Directory Tests", "rd_test <test number>", RunTest));
     table.Add("rd_clean", new Dispatch("delete all resources", "rd_clean", CleanAll));
 }
Esempio n. 7
0
 public static void FillDispatchTable(DispatchTable table)
 {
     table.Add("KdcToken", new Dispatch("KdcToken <AS> <Audience> <Scope> <OscoreKeys> <Kdc> <store>", "Ask an AS for a KDC token", KdcToken));
     table.Add("kdc-join", new Dispatch("kdc-join", "Try to join ", KdcJoin));
 }