Path: blob/master/src/java.security.jgss/share/classes/sun/security/jgss/spi/GSSNameSpi.java
41161 views
/*1* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.security.jgss.spi;2627import org.ietf.jgss.*;28import java.security.Provider;2930/**31* This interface is implemented by a mechanism specific name element. A32* GSSName is conceptually a container class of several name elements from33* different mechanisms.34*35* @author Mayank Upadhyay36*/3738public interface GSSNameSpi {3940public Provider getProvider();4142/**43* Equals method for the GSSNameSpi objects.44* If either name denotes an anonymous principal, the call should45* return false.46*47* @param name to be compared with48* @return true if they both refer to the same entity, else false49* @exception GSSException with major codes of BAD_NAMETYPE,50* BAD_NAME, FAILURE51*/52public boolean equals(GSSNameSpi name) throws GSSException;5354/**55* Compares this <code>GSSNameSpi</code> object to another Object56* that might be a <code>GSSNameSpi</code>. The behaviour is exactly57* the same as in {@link #equals(GSSNameSpi) equals} except that58* no GSSException is thrown; instead, false will be returned in the59* situation where an error occurs.60*61* @param another the object to be compared to62* @return true if they both refer to the same entity, else false63* @see #equals(GSSNameSpi)64*/65public boolean equals(Object another);6667/**68* Returns a hashcode value for this GSSNameSpi.69*70* @return a hashCode value71*/72public int hashCode();7374/**75* Returns a flat name representation for this object. The name76* format is defined in RFC 2078.77*78* @return the flat name representation for this object79* @exception GSSException with major codes NAME_NOT_MN, BAD_NAME,80* BAD_NAME, FAILURE.81*/82public byte[] export() throws GSSException;838485/**86* Get the mechanism type that this NameElement corresponds to.87*88* @return the Oid of the mechanism type89*/90public Oid getMechanism();9192/**93* Returns a string representation for this name. The printed94* name type can be obtained by calling getStringNameType().95*96* @return string form of this name97* @see #getStringNameType()98* @overrides Object#toString99*/100public String toString();101102103/**104* Returns the oid describing the format of the printable name.105*106* @return the Oid for the format of the printed name107*/108public Oid getStringNameType();109110/**111* Indicates if this name object represents an Anonymous name.112*/113public boolean isAnonymousName();114}115116117