2 * Copyright (c) 2014 <copyright holder> <email>
4 * For license details, see the LICENSE file in the root of this project.
8 #ifndef GSSACQUIRECREDCOMMAND_H
9 #define GSSACQUIRECREDCOMMAND_H
11 #include "GSSCommand.h"
12 #include "datamodel/GSSCredential.h"
13 #include "datamodel/GSSOIDSet.h"
14 #include "datamodel/GSSName.h"
15 #include <gssapi/gssapi.h>
17 class GSSAcquireCred : public GSSCommand
20 GSSAcquireCred( gss_acq_cred_type fn = &gss_acquire_cred );
21 GSSAcquireCred ( const GSSAcquireCred& other );
22 GSSAcquireCred ( JSONObject *params, gss_acq_cred_type fn = &gss_acquire_cred );
25 GSSAcquireCred& operator= ( const GSSAcquireCred& other );
27 virtual void execute();
28 virtual JSONObject* toJSON();
29 bool loadParameters(JSONObject *params);
31 gss_acq_cred_type getGSSFunction() { return function; };
33 void addDesiredMech ( const GSSOID &newOID ) { this->desiredMechs.addOID(newOID.toGss()); }
36 void setDesiredName(const GSSName &name) { this->desired_name = name; }
37 void setTimeReq(OM_uint32 request) { this->time_req = request; }
38 void setCredUsage ( OM_uint32 credential_usage ) {this->cred_usage = credential_usage; }
40 GSSName getDesiredName() { return(desired_name); }
41 OM_uint32 getTimeReq() { return(time_req); }
42 gss_cred_id_t getOutputCredHandle() const { return( cred.toGss() ); }
43 OM_uint32 getRetVal() { return(retVal); }
44 OM_uint32 getMinorStatus() { return(minor_status); }
45 gss_OID_set getDesiredMechs() const { return(desiredMechs.toGss()); }
46 gss_cred_usage_t getCredUsage() const { return(cred_usage); }
47 gss_OID_set getActualMechs() const { return( actualMechs.toGss() ); }
48 OM_uint32 getTimeRec() { return(time_rec); }
53 OM_uint32 time_req, time_rec;
54 GSSOIDSet desiredMechs;
55 GSSOIDSet actualMechs;
56 gss_cred_usage_t cred_usage;
57 OM_uint32 retVal, minor_status;
59 gss_acq_cred_type function;
63 #endif // GSSACQUIRECREDCOMMAND_H