1280b976742ab3a63800bb2e816a1c21d0447b42
[gssweb.git] / json_gssapi / src / datamodel / GSSOID.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 #include <string>
9 #include "gssapi.h"
10 #include "../util_json.h"
11
12 #include "GSSBuffer.h"
13
14 #ifndef GSSOID_H
15 #define GSSOID_H
16
17 class GSSOID { 
18 public:
19   GSSOID() { oid = GSS_C_NO_OID; gssInternal = true; };
20   GSSOID(char *oid_str);
21   GSSOID(std::string oid_str);
22   GSSOID(GSSBuffer oid_str);
23   GSSOID(gss_OID gssoid);
24   GSSOID(const GSSOID &gssoid);
25   ~GSSOID();
26   
27   gss_OID toGss() const { return(oid); };
28   std::string toString() const;
29   
30   bool setValue(GSSBuffer buf);
31   bool setValue(gss_OID   gssOID);
32
33   JSONObject *toJSONValue() const;
34 private:
35   gss_OID oid;
36   bool gssInternal;
37   
38   void init(GSSBuffer oid_str);
39   void release();
40 };
41
42
43 #endif // GSSOID_H