e324bc5dc8c6106bb69e36d3bebb2eb02a3bf965
[gssweb.git] / json_gssapi / src / datamodel / GSSCredential.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 GSSCREDENTIAL_H
9 #define GSSCREDENTIAL_H
10
11 #include "../util_json.h"
12 #include <gssapi/gssapi.h>
13 #include <string>
14
15 typedef OM_uint32 (KRB5_CALLCONV *gss_acq_cred_type)(
16     OM_uint32 *,        /* minor_status */
17     gss_name_t,         /* desired_name */
18     OM_uint32,          /* time_req */
19     gss_OID_set,        /* desired_mechs */
20     gss_cred_usage_t,   /* cred_usage */
21     gss_cred_id_t *,    /* output_cred_handle */
22     gss_OID_set *,      /* actual_mechs */
23     OM_uint32 *);       /* time_rec */
24
25
26
27 class GSSCredential
28 {
29 public:
30     GSSCredential();
31     GSSCredential(const GSSCredential &other);
32     GSSCredential(gss_cred_id_t cred) : credential(cred) {};
33     ~GSSCredential();
34     
35     GSSCredential& operator= (const GSSCredential &gsscred);
36     
37     gss_cred_id_t toGss() const { return(credential); }
38     
39     void setValue(gss_cred_id_t cred) { this->credential = cred; }
40     JSONObject *toJSONValue() { return( new JSONObject("not now") ); }
41     
42 private:
43     gss_cred_id_t credential;
44     
45 };
46
47 #endif // GSSCREDENTIAL_H