com.ibm.security.jgss

Class GSSNameImpl

  1. java.lang.Object
  2. extended bycom.ibm.security.jgss.GSSNameImpl
All implemented interfaces:
GSSName

  1. public class GSSNameImpl
  2. extends java.lang.Object
  3. implements GSSName
Implements GSSName.
Author:
Thomas Owusu

Field Summary

Modifier and Type Field and Description
  1. static
  2. Oid
NT_HOSTBASED_SERVICE_RFC2743
Fields inherited from interface org.ietf.jgss.GSSName
NT_ANONYMOUS, NT_EXPORT_NAME, NT_HOSTBASED_SERVICE, NT_MACHINE_UID_NAME, NT_STRING_UID_NAME, NT_USER_NAME

Method Summary

Modifier and Type Method and Description
  1. GSSName
canonicalize(Oid mechType)
  1. boolean
equals(GSSName otherName)
  1. boolean
equals(java.lang.Object otherName)
  1. byte[]
export()
Exports name a mechanism name as specified in RFC-2743 (section 3.2) which is quoted below: 3.2: Mechanism-Independent Exported Name Object Format This section specifies a mechanism-independent level of encapsulating representation for names exported via the GSS_Export_name() call, including an object identifier representing the exporting mechanism.
  1. GSSNameSpi
getMechName(Oid mech)
  1. Oid
getStringNameType()
  1. int
hashCode()
  1. boolean
isAnonymous()
  1. boolean
isMN()
  1. java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

NT_HOSTBASED_SERVICE_RFC2743

  1. public static Oid NT_HOSTBASED_SERVICE_RFC2743

Method Detail

equals

  1. public boolean equals(GSSName otherName)
  2. throws GSSException
Description copied from interface: GSSName
Compares two GSSName objects to determine whether they refer to the same entity. This method may throw a GSSException when the names cannot be compared. If either of the names represents an anonymous entity, the method will return "false".
Specified by:
equals in interface GSSName
Parameters:
otherName - GSSName object to compare with.
Returns:
"true" if the two GSSName objects refer to the same entity.
Throws:

equals

  1. public boolean equals(java.lang.Object otherName)
Description copied from interface: GSSName
A variation of the equals method that is provided to override the Object.equals() method that the implementing class will inherit. The behaviour is exactly the same as other equals method except that no GSSException is thrown; instead, false will be returned in the situation where an error occurs.
Specified by:
equals in interface GSSName
Overrides:
equals in class java.lang.Object
Returns:
"true" if the two GSSName objects refer to the same entity.

hashCode

  1. public int hashCode()
Description copied from interface: GSSName
Returns a hashcode value for this GSSName.
Specified by:
hashCode in interface GSSName
Overrides:
hashCode in class java.lang.Object
Returns:
a hashCode value

canonicalize

  1. public GSSName canonicalize(Oid mechType)
  2. throws GSSException
Description copied from interface: GSSName
Creates a mechanism name (MN) from an arbitrary internal name. This is equivalent to using the factory methods GSSManager.createName(String, Oid, Oid) and GSSManager.createName(byte[], Oid, Oid) that take the mechanism name as one of their parameters.
Specified by:
canonicalize in interface GSSName
Returns:
The mechanism name for the specified mechanism.
Throws:

export

  1. public byte[] export()
  2. throws GSSException
Exports name a mechanism name as specified in RFC-2743 (section 3.2) which is quoted below: 3.2: Mechanism-Independent Exported Name Object Format This section specifies a mechanism-independent level of encapsulating representation for names exported via the GSS_Export_name() call, including an object identifier representing the exporting mechanism. The format of names encapsulated via this representation shall be defined within individual mechanism drafts. The Object Identifier value to indicate names of this type is defined in Section 4.7 of this document. No name type OID is included in this mechanism-independent level of format definition, since (depending on individual mechanism specifications) the enclosed name may be implicitly typed or may be explicitly typed using a means other than OID encoding. The bytes within MECH_OID_LEN and NAME_LEN elements are represented most significant byte first (equivalently, in IP network byte order). Length Name Description 2 TOK_ID Token Identifier For exported name objects, this must be hex 04 01. 2 MECH_OID_LEN Length of the Mechanism OID MECH_OID_LEN MECH_OID Mechanism OID, in DER 4 NAME_LEN Length of name NAME_LEN NAME Exported name; format defined in applicable mechanism draft. A concrete example of the contents of an exported name object, derived from the Kerberos Version 5 mechanism, is as follows: 04 01 00 0B 06 09 2A 86 48 86 F7 12 01 02 02 hx xx xx xl pp qq ... zz 04 01 mandatory token identifier 00 0B 2-byte length of the immediately following DER-encoded ASN.1 value of type OID, most significant octet first 06 09 2A 86 48 86 F7 12 01 02 02 DER-encoded ASN.1 value of type OID; Kerberos V5 mechanism OID indicates Kerberos V5 exported name in Detail: 06 Identifier octet (6=OID) 09 Length octet(s) 2A 86 48 86 F7 12 01 02 02 Content octet(s) hx xx xx xl 4-byte length of the immediately following exported name blob, most significant octet first pp qq ... zz exported name blob of specified length, bits and bytes specified in the (Kerberos 5) GSS-API v2 mechanism spec
Specified by:
export in interface GSSName
Returns:
Byte array representing this mechanism name (MN).
Throws:
GSSException - if the name is not a mechanism name (MN) or other errors occur during the export operation.

toString

  1. public java.lang.String toString( )
Description copied from interface: GSSName
Returns a textual representation of the GSSName object. To retrieve the printed name format, which determines the syntax of the returned string, the getStringNameType method can be used.
Specified by:
toString in interface GSSName
Overrides:
toString in class java.lang.Object
Returns:
A string form of this GSSName.

getStringNameType

  1. public Oid getStringNameType()
  2. throws GSSException
Description copied from interface: GSSName
Returns the oid representing the type of name returned through the toString method. Using this oid, the syntax of the printable name can be determined.
Specified by:
getStringNameType in interface GSSName
Returns:
Oid representing the name type used in the toString method.
Throws:

isAnonymous

  1. public boolean isAnonymous()
Description copied from interface: GSSName
Tests if this name object represents an anonymous entity. Returns "true" if this is an anonymous name.
Specified by:
isAnonymous in interface GSSName
Returns:
"true" if this name anonymous.

isMN

  1. public boolean isMN()
Description copied from interface: GSSName
Tests if this name object contains only one mechanism element and is thus a mechanism name as defined by RFC 2078.
Specified by:
isMN in interface GSSName
Returns:
"true" if this is a mechanism name.

getMechName

  1. public GSSNameSpi getMechName(Oid mech)