com.ibm.security.jgss
Class GSSNameImpl
- java.lang.Object
com.ibm.security.jgss.GSSNameImpl
All implemented interfaces:
- public class GSSNameImpl
- extends java.lang.Object
- implements GSSName
Author:
Thomas Owusu
Field Summary
Modifier and Type | Field and Description |
---|---|
|
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 |
---|---|
canonicalize(Oid mechType)
|
|
|
equals(GSSName otherName)
|
|
equals(java.lang.Object otherName)
|
|
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.
|
getMechName(Oid mech)
|
|
getStringNameType()
|
|
|
hashCode()
|
|
isAnonymous()
|
|
isMN()
|
|
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail
NT_HOSTBASED_SERVICE_RFC2743
- public static Oid NT_HOSTBASED_SERVICE_RFC2743
Method Detail
equals
- public boolean equals(GSSName otherName)
- throws GSSException
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".
Parameters:
otherName
- GSSName object to compare with. Returns:
"true" if the two GSSName objects refer to the same entity.
Throws:
equals
- 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.
Returns:
"true" if the two GSSName objects refer to the same entity.
hashCode
- public int hashCode()
Description copied from interface:
GSSName
Returns a hashcode value for this GSSName.
Returns:
a hashCode value
canonicalize
- public GSSName canonicalize(Oid mechType)
- 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
export
- public byte[] export()
- 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
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
- 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.
Returns:
A string form of this GSSName.
getStringNameType
- public Oid getStringNameType()
- 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
isAnonymous
- 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
- 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.
Returns:
"true" if this is a mechanism name.
getMechName
- public GSSNameSpi getMechName(Oid mech)
GSSName