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 : GSSCommand
20 GSSAcquireCred( gss_acq_cred_type fn = &gss_acquire_cred );
21 GSSAcquireCred ( const GSSAcquireCred& other );
22 GSSAcquireCred ( JSONObject params );
25 GSSAcquireCred& operator= ( const GSSAcquireCred& other );
27 virtual void execute();
28 virtual JSONObject* toJSON();
30 gss_acq_cred_type getGSSFunction() { return function; };
32 void addDesiredMech ( const GSSOID &newOID ) { this->desiredMechs.addOID(newOID.toGss()); }
35 void setDesiredName(const GSSName &name) { this->desired_name = name; }
36 void setTimeReq(OM_uint32 request) { this->time_req = request; }
37 void setCredUsage ( OM_uint32 credential_usage ) {this->cred_usage = credential_usage; }
39 GSSName getDesiredName() { return(desired_name); }
40 OM_uint32 getTimeReq() { return(time_req); }
41 gss_cred_id_t getOutputCredHandle() const { return( cred.toGss() ); }
42 OM_uint32 getRetVal() { return(retVal); }
43 OM_uint32 getMinorStatus() { return(minor_status); }
44 gss_OID_set getDesiredMechs() const { return(desiredMechs.toGss()); }
45 gss_cred_usage_t getCredUsage() const { return(cred_usage); }
46 gss_OID_set getActualMechs() const { return( actualMechs.toGss() ); }
47 OM_uint32 getTimeRec() { return(time_rec); }
52 OM_uint32 time_req, time_rec;
53 GSSOIDSet desiredMechs;
54 GSSOIDSet actualMechs;
55 gss_cred_usage_t cred_usage;
56 OM_uint32 retVal, minor_status;
58 gss_acq_cred_type function;
62 #endif // GSSACQUIRECREDCOMMAND_H