Commit an overly-large chunk of work.
[gssweb.git] / json_gssapi / src / datamodel / GSSContext.h
diff --git a/json_gssapi/src/datamodel/GSSContext.h b/json_gssapi/src/datamodel/GSSContext.h
new file mode 100644 (file)
index 0000000..bbd2f34
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014 <copyright holder> <email>
+ *
+ * For license details, see the LICENSE file in the root of this project.
+ *
+ */
+
+#ifndef GSSCONTEXT_H
+#define GSSCONTEXT_H
+
+#include <gssapi/gssapi.h>
+
+#include "datamodel/GSSBuffer.h"
+
+class GSSCreateSecContextTest;
+class GSSContext
+{
+public:
+    GSSContext();
+    GSSContext ( const GSSContext& other );
+    GSSContext ( gss_ctx_id_t ctxt, bool skipRelease = false ) : context(ctxt), skipRelease(skipRelease) {};
+    ~GSSContext();
+    GSSContext& operator= ( const GSSContext& other );
+    
+    void release(GSSBuffer *output);
+    
+    gss_ctx_id_t getContext() { return(context); };
+    void setContext(gss_ctx_id_t ctxt, bool skipRelease = false);
+    
+private:
+    gss_ctx_id_t context;
+    bool skipRelease; 
+};
+
+#endif // GSSCONTEXT_H