For backward compatibility with earlier versions of the GSS-API, thisimplementation of the GSS-API supports the functiongss_str_to_oid().gss_str_to_oid() converts a string that represents a mechanism orQOP to an OID. The string can be either as a number or a word.
Caution - gss_str_to_oid(),gss_oid_to_str(),andgss_release_oid() are not supported by some implementationsof the GSS-API to discourage the use of explicit, non-default mechanisms andQOPs. |
The mechanism string can be hard-coded in the application or come fromuser input. However, not all implementations of the GSS-API supportgss_str_to_oid(), so applications should not rely on this function.
The number that represents a mechanism can have two differentformats. The first format,{ 1 2 3 4 }, is officially mandatedby the GSS-API specifications. The second format,1.2.3.4, is more widely used butis not an official standard format.gss_str_to_oid() expectsthe mechanism number in the first format, so you must convert the string ifthe string is in the second format before callinggss_str_to_oid().An example ofgss_str_to_oid() is shown inExample 30, Using createMechOid to Create a Mechanism OID. If the mechanismis not a valid one,gss_str_to_oid() returnsGSS_S_BAD_MECH.
Becausegss_str_to_oid() allocates GSS-API data space,thegss_release_oid() function exists is provided to removethe allocated OID when you are finished. Likegss_str_to_oid(),gss_release_oid() is not a generally supported function and shouldnot be relied upon in programs that aspire to universal portability.