2 * Copyright (c) 2014 <copyright holder> <email>
4 * For license details, see the LICENSE file in the root of this project.
10 GSSUnwrap::GSSUnwrap ( JSONObject* params, gss_unwrap_type fn )
13 loadParameters(params);
16 bool GSSUnwrap::loadParameters(JSONObject *params)
19 std::string sInputMessage;
30 if ( ! params->get("arguments").get("input_message").isNull() )
32 sInputMessage = params->get("arguments").get("input_message").string();
33 this->inputMessage.setValue(sInputMessage);
42 void GSSUnwrap::execute()
45 gss_buffer_desc output_buf;
48 &(this->minor_status),
50 this->inputMessage.toGss(),
56 this->outputMessage.setValue( (char *)output_buf.value, output_buf.length );
59 JSONObject* GSSUnwrap::toJSON()
62 const char *conf_state;
63 JSONObject *ret = new JSONObject();
64 JSONObject *values = new JSONObject();
73 values->set("major_status", this->retVal);
74 values->set("minor_status", this->minor_status);
76 values->set("qop_state", this->qop_state);
78 conf_state = (this->conf_state) ? "TRUE" : "FALSE";
79 values->set("conf_state", conf_state);
83 this->outputMessage.toString().c_str()
86 // Put it all together.
87 ret->set("command", "gss_wrap");
88 ret->set("return_values", *values);