bbd2f342b9066303c051876e7068611b2ed9bf61
[gssweb.git] / json_gssapi / src / datamodel / GSSContext.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 GSSCONTEXT_H
9 #define GSSCONTEXT_H
10
11 #include <gssapi/gssapi.h>
12
13 #include "datamodel/GSSBuffer.h"
14
15 class GSSCreateSecContextTest;
16 class GSSContext
17 {
18 public:
19     GSSContext();
20     GSSContext ( const GSSContext& other );
21     GSSContext ( gss_ctx_id_t ctxt, bool skipRelease = false ) : context(ctxt), skipRelease(skipRelease) {};
22     ~GSSContext();
23     GSSContext& operator= ( const GSSContext& other );
24     
25     void release(GSSBuffer *output);
26     
27     gss_ctx_id_t getContext() { return(context); };
28     void setContext(gss_ctx_id_t ctxt, bool skipRelease = false);
29     
30 private:
31     gss_ctx_id_t context;
32     bool skipRelease; 
33 };
34
35 #endif // GSSCONTEXT_H