26d671fd52badfec9bd133f23844f5e08583b0cb
[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   GSSBuffer getInputNameType() { return GSSBuffer(inputNameType); }
28   
29   gss_imp_name_type getGSSFunction() { return function; }
30   
31 private:
32   gss_imp_name_type function;
33   bool loadParameters(JSONObject *params);
34   GSSBuffer inputName;
35   GSSBuffer inputNameType;
36
37 };
38
39 #endif // GSSIMPORTNAME_H