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"
13 GSSOIDSet::GSSOIDSet( )
18 void GSSOIDSet::init()
21 OM_uint32 major, minor;
26 major = gss_create_empty_oid_set(&minor, &(this->set));
28 // How the heck would this happen, anyway?
30 throw GSSException("Could not create an empty OID set.", major, minor);
36 GSSOIDSet::~GSSOIDSet()
38 this->releaseOIDSet();
41 void GSSOIDSet::releaseOIDSet()
44 OM_uint32 major, minor;
49 major = gss_release_oid_set(&minor, &(this->set));
51 throw GSSException("Error in releasing memory for an OID set", major, minor);
56 GSSOIDSet& GSSOIDSet::operator= ( const gss_OID_set other )
65 this->releaseOIDSet();
67 for(i = 0; i < other->count; i++)
69 element = other->elements + i;
70 this->addOID(element);
78 void GSSOIDSet::addOID ( const GSSOID other )
80 this->addOID(other.toGss());
83 void GSSOIDSet::addOID( const gss_OID other )
86 OM_uint32 major, minor;
90 major = gss_add_oid_set_member(&minor, other, &(this->set) );
92 throw GSSException("Error encountered while trying to add another OID to a set", major, minor);