2 * Copyright (c) 2014 <copyright holder> <email>
4 * For license details, see the LICENSE file in the root of this project.
9 #include "../GSSException.h"
11 GSSOID::GSSOID(std::string oid_str)
13 init( GSSBuffer(oid_str) );
16 GSSOID::GSSOID(char *oid_str)
18 init( GSSBuffer(oid_str) );
21 GSSOID::GSSOID(GSSBuffer oid_str)
26 GSSOID::GSSOID(gss_OID gssoid)
29 this->gssInternal = true;
34 OM_uint32 major, minor;
35 if (! this->gssInternal)
37 major = gss_release_oid(&minor, &(this->oid));
40 throw GSSException("Error in releasing a GSS OID", major, minor);
45 void GSSOID::init(GSSBuffer oid_str)
48 OM_uint32 major, minor;
54 major = gss_str_to_oid(&minor, oid_str.toGss(), &(this->oid));
57 throw GSSException("Error creating GSS OID", major, minor);
59 this->gssInternal = false;
65 std::string GSSOID::toString()
68 OM_uint32 major, minor;
75 major = gss_oid_to_str(&minor, this->oid, &buf);
78 throw GSSException("Error in creating a string representation of a GSS OID",
81 ret = std::string((char *)buf.value);
84 major = gss_release_buffer(&minor, &buf);
87 throw GSSException("Error releasing a gss_buffer",