2362N/A * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * Implements the GSSNameSpi for the krb5 mechanism. 0N/A * @author Mayank Upadhyay 0N/A // XXX Move this concept into PrincipalName's asn1Encode() sometime 0N/A * Instantiates a new Krb5NameElement object. Internally it stores the 0N/A * information provided by the input parameters so that they may later 0N/A * be used for output when a printable representaion of this name is 0N/A * needed in GSS-API format rather than in Kerberos format. 0N/A * A null gssNameType implies that the mechanism default 0N/A * Krb5MechFactory.NT_GSS_KRB5_PRINCIPAL be used. 0N/A +
" is an unsupported nametype");
0N/A * We have forms of GSS name strings that can come in: 0N/A * 1. names of the form "foo" with just one 0N/A * component. (This might include a "@" but only in escaped 0N/A * 2. names of the form "foo@bar" with two components 0N/A * The nametypes that are accepted are NT_USER_NAME, and 0N/A * NT_HOSTBASED_SERVICE. 0N/A // XXX Perhaps provide this parsing code in PrincipalName 0N/A // Look for @ as in service@host 0N/A // Assumes host name will not have an escaped '@' 0N/A // Not really a separator if it is escaped. Then this is just part 0N/A // of the principal name or service name 0N/A // Is the `\` character escaped itself? 0N/A // A lack of "@" defaults to the service being on the local 0N/A // host as per RFC 2743 0N/A // XXX Move this part into JGSS framework 0N/A // use hostname as it is 0N/A * Equal method for the GSSNameSpi objects. 0N/A * If either name denotes an anonymous principal, the call should 0N/A * @param name to be compared with 0N/A * @returns true if they both refer to the same entity, else false 0N/A * @exception GSSException with major codes of BAD_NAMETYPE, 0N/A * Compares this <code>GSSNameSpi</code> object to another Object 0N/A * that might be a <code>GSSNameSpi</code>. The behaviour is exactly 0N/A * the same as in {@link #equals(GSSNameSpi) equals} except that 0N/A * no GSSException is thrown; instead, false will be returned in the 0N/A * situation where an error occurs. 0N/A * @param another the object to be compared to 0N/A * @returns true if they both refer to the same entity, else false 0N/A * @see #equals(GSSNameSpi) 0N/A * Returns a hashcode value for this GSSNameSpi. 0N/A * @return a hashCode value 0N/A * Returns the principal name in the form user@REALM or 0N/A * imposed by RFC 1964: 0N/A * (1) all occurrences of the characters `@`, `/`, and `\` within 0N/A * principal components or realm names shall be quoted with an 0N/A * immediately-preceding `\`. 0N/A * (2) all occurrences of the null, backspace, tab, or newline 0N/A * characters within principal components or realm names will be 0N/A * represented, respectively, with `\0`, `\b`, `\t`, or `\n`. 0N/A * (3) the `\` quoting character shall not be emitted within an 0N/A * exported name except to accomodate cases (1) and (2). 0N/A // XXX Apply the above constraints. 0N/A * Get the mechanism type that this NameElement corresponds to. 0N/A * @return the Oid of the mechanism type 0N/A * Returns a string representation for this name. The printed 0N/A * name type can be obtained by calling getStringNameType(). 0N/A * @return string form of this name 0N/A * @see #getStringNameType() 0N/A * @overrides Object#toString 0N/A // For testing: return (super.toString()); 0N/A * Returns the name type oid. 0N/A * Returns the oid describing the format of the printable name. 0N/A * @return the Oid for the format of the printed name 0N/A // XXX For NT_EXPORT_NAME return a different name type. Infact, 0N/A // don't even store NT_EXPORT_NAME in the cons. 0N/A * Indicates if this name object represents an Anonymous name.