public GSSName canonicalize(Oid mech) throws GSSException {
long maj_status = 0;
long[] min_status = {0};
int ret = 0;
gss_OID_desc tmpOid;
GSSNameImpl canonicalName = new GSSNameImpl();
gss_name_t_desc tmpName = new gss_name_t_desc();
if (mech == null) {
tmpOid = new gss_OID_desc("1.2.840.113554.1.2.2");
} else {
/* note that underlying native MIT gssapi library only supports
gss_mech_krb5_old and gss_mech_krb5 mechanism types, so
we're explicity requiring gss_mech_krb5 to be used */
tmpOid = mech.getNativeOid();
if (!tmpOid.toDotString().equals("1.2.840.113554.1.2.2")) {
throw new GSSExceptionImpl((int)maj_status, (int)min_status[0]);
}
}
maj_status = gsswrapper.gss_canonicalize_name(min_status,