2 * Copyright (c) 2014 <copyright holder> <email>
4 * For license details, see the LICENSE file in the root of this project.
8 #include "GSSAcquireCred.h"
9 #include "GSSException.h"
11 GSSAcquireCred::GSSAcquireCred(gss_acq_cred_type fn) : function(fn)
16 GSSAcquireCred::GSSAcquireCred ( const GSSAcquireCred& other )
21 GSSAcquireCred::~GSSAcquireCred()
26 GSSAcquireCred& GSSAcquireCred::operator= ( const GSSAcquireCred& other )
31 GSSAcquireCred::GSSAcquireCred ( JSONObject params ) : GSSCommand ( params )
37 void GSSAcquireCred::execute()
40 gss_cred_id_t output_cred_handle;
41 gss_OID_set actual_mechs;
46 this->retVal = function(
48 this->desired_name.toGss(),
50 this->desiredMechs.toGss(),
57 if (GSS_ERROR(this->retVal) )
59 std::string err("Error acquiring credential for user '");
60 err += desired_name.toString();
62 throw GSSException(err, this->retVal, this->minor_status);
65 this->cred.setValue(output_cred_handle);
66 this->actualMechs = actual_mechs;
72 JSONObject *GSSAcquireCred::toJSON()
74 return new JSONObject();