9adea4d2621c004625273a69b3f205517ffd69aa
[gssweb.git] / json_gssapi / src / GSSImportName.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 GSSIMPORTNAME_H
9 #define GSSIMPORTNAME_H
10
11 #include "GSSCommand.h"
12 #include "datamodel/GSSBuffer.h"
13 #include "datamodel/GSSName.h"
14
15 #include <gssapi.h>
16
17 class GSSImportName : public GSSCommand
18 {
19 public:
20   GSSImportName(gss_imp_name_type fn = &gss_import_name) : function(fn) {};
21   GSSImportName(JSONObject *params, gss_imp_name_type fn = &gss_import_name);
22   
23   void execute();
24   JSONObject* toJSON();
25   
26   GSSBuffer getInputName() { return GSSBuffer(inputName); };
27   GSSOID getInputNameType() { return GSSOID(inputNameType); };
28   
29   gss_imp_name_type getGSSFunction() { return function; };
30   void setInputName ( std::string name ) { inputName.setValue(name); };
31   void setInputNameType ( std::string type ) { inputNameType.setValue(type); };
32   
33 private:
34   gss_imp_name_type function;
35   bool loadParameters(JSONObject *params);
36   
37   OM_uint32 retVal;
38   OM_uint32 minor_status;
39   GSSBuffer inputName;
40   GSSOID    inputNameType;
41   GSSName   outputName;
42 };
43
44 #endif // GSSIMPORTNAME_H