sun.security.mule.jgss.krb5
Class Krb5NameElement

java.lang.Object
  extended by sun.security.mule.jgss.krb5.Krb5NameElement
All Implemented Interfaces:
GSSNameSpi

public class Krb5NameElement
extends Object
implements GSSNameSpi

Implements the GSSNameSpi for the krb5 mechanism.

Author:
Mayank Upadhyay

Method Summary
 boolean equals(GSSNameSpi other)
          Equal method for the GSSNameSpi objects.
 boolean equals(Object another)
          Compares this GSSNameSpi object to another Object that might be a GSSNameSpi.
 byte[] export()
          Returns the principal name in the form user@REALM or host/service@REALM but with the following contraints that are imposed by RFC 1964:
 Oid getGSSNameType()
          Returns the name type oid.
static Krb5NameElement getInstance(PrincipalName principalName)
           
static Krb5NameElement getInstance(String gssNameStr, Oid gssNameType, Config kerberosConfig)
          Instantiates a new Krb5NameElement object.
 PrincipalName getKrb5PrincipalName()
           
 Oid getMechanism()
          Get the mechanism type that this NameElement corresponds to.
 Provider getProvider()
           
 Oid getStringNameType()
          Returns the oid describing the format of the printable name.
 int hashCode()
          Returns a hashcode value for this GSSNameSpi.
 boolean isAnonymousName()
          Indicates if this name object represents an Anonymous name.
 String toString()
          Returns a string representation for this name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static Krb5NameElement getInstance(String gssNameStr,
                                          Oid gssNameType,
                                          Config kerberosConfig)
                                   throws GSSException
Instantiates a new Krb5NameElement object. Internally it stores the information provided by the input parameters so that they may later be used for output when a printable representaion of this name is needed in GSS-API format rather than in Kerberos format.

Throws:
GSSException

getInstance

public static Krb5NameElement getInstance(PrincipalName principalName)

getKrb5PrincipalName

public final PrincipalName getKrb5PrincipalName()

equals

public boolean equals(GSSNameSpi other)
               throws GSSException
Equal method for the GSSNameSpi objects. If either name denotes an anonymous principal, the call should return false.

Specified by:
equals in interface GSSNameSpi
Parameters:
name - to be compared with
Throws:
GSSException - with major codes of BAD_NAMETYPE, BAD_NAME, FAILURE

equals

public boolean equals(Object another)
Compares this GSSNameSpi object to another Object that might be a GSSNameSpi. The behaviour is exactly the same as in equals except that no GSSException is thrown; instead, false will be returned in the situation where an error occurs.

Specified by:
equals in interface GSSNameSpi
Overrides:
equals in class Object
Parameters:
another - the object to be compared to
See Also:
equals(GSSNameSpi)

hashCode

public int hashCode()
Returns a hashcode value for this GSSNameSpi.

Specified by:
hashCode in interface GSSNameSpi
Overrides:
hashCode in class Object
Returns:
a hashCode value

export

public byte[] export()
              throws GSSException
Returns the principal name in the form user@REALM or host/service@REALM but with the following contraints that are imposed by RFC 1964:
  (1) all occurrences of the characters `@`,  `/`, and `\` within
   principal components or realm names shall be quoted with an
   immediately-preceding `\`.
 
   (2) all occurrences of the null, backspace, tab, or newline
   characters within principal components or realm names will be
   represented, respectively, with `\0`, `\b`, `\t`, or `\n`.
 
   (3) the `\` quoting character shall not be emitted within an
   exported name except to accomodate cases (1) and (2).
 

Specified by:
export in interface GSSNameSpi
Returns:
the flat name representation for this object
Throws:
GSSException - with major codes NAME_NOT_MN, BAD_NAME, BAD_NAME, FAILURE.

getMechanism

public Oid getMechanism()
Get the mechanism type that this NameElement corresponds to.

Specified by:
getMechanism in interface GSSNameSpi
Returns:
the Oid of the mechanism type

toString

public String toString()
Returns a string representation for this name. The printed name type can be obtained by calling getStringNameType().

Specified by:
toString in interface GSSNameSpi
Overrides:
toString in class Object
Returns:
string form of this name
See Also:
getStringNameType()

getGSSNameType

public Oid getGSSNameType()
Returns the name type oid.


getStringNameType

public Oid getStringNameType()
Returns the oid describing the format of the printable name.

Specified by:
getStringNameType in interface GSSNameSpi
Returns:
the Oid for the format of the printed name

isAnonymousName

public boolean isAnonymousName()
Indicates if this name object represents an Anonymous name.

Specified by:
isAnonymousName in interface GSSNameSpi

getProvider

public Provider getProvider()
Specified by:
getProvider in interface GSSNameSpi


Copyright © 2013. All Rights Reserved.