A bunch of changes as the command line now works.
[gssweb.git] / json_gssapi / src / commands / GSSCreateSecContextCommand.h
1 /*
2  * Copyright (c) 2014 <copyright holder> <email>
3  * 
4  * For license details, see the LICENSE file in the root of this project.
5  * 
6  */
7
8 #ifndef GSSCREATESECCONTEXTCOMMAND_H
9 #define GSSCREATESECCONTEXTCOMMAND_H
10
11 #include "GSSCommand.h"
12 #include <datamodel/GSSContext.h>
13 #include <datamodel/GSSName.h>
14 #include <datamodel/GSSOID.h>
15 #include <gssapi.h>
16
17 class GSSCreateSecContextCommand : public GSSCommand
18 {
19 public:
20
21     OM_uint32 retVal;
22     OM_uint32 minor_status;
23     gss_ctx_id_t context_handle;
24     gss_name_t target_name;
25     OM_uint32 req_flags;
26     OM_uint32 time_req;
27     gss_buffer_desc input_token;
28     gss_buffer_desc output_token;
29     OM_uint32 ret_flags;
30     OM_uint32 time_rec;
31     
32   
33     void execute();
34     JSONObject *toJSON();
35     GSSCreateSecContextCommand(void *fn = (void *)&gss_init_sec_context);
36     GSSCreateSecContextCommand(JSONObject *params, void *fn = (void *)&gss_init_sec_context);
37     
38     bool loadParameters(JSONObject *params);
39     bool zeroOut(bool initialized = true);
40     
41     
42     // accessors
43     OM_uint32 getReqFlags() { return req_flags; }
44     OM_uint32 getTimeReq() { return time_req; }
45     gss_ctx_id_t getContextHandle() { return context_handle; }
46     void *getGSSFunction() { return function; }
47     GSSOID getMechType() { return mechType; };
48     GSSOID getActualMechType() { return actualMechType; };
49     
50     // complex accessors
51     const char * getTargetDisplayName();
52     
53 private:
54     void *function;
55     GSSContext context;
56     GSSOID mechType;
57     GSSOID actualMechType;
58     GSSName targetName;
59     std::string contextKey;
60 };
61
62 #endif // GSSCREATESECCONTEXTCOMMAND_H