| java.lang.Object |
| ↳ |
sun.security.mule.jgss.GSSNameImpl |
Class Overview
This is the implementation class for GSSName. Conceptually the
GSSName is a container with mechanism specific name elements. Each
name element is a representation of how that particular mechanism
would canonicalize this principal.
Generally a GSSName is created by an application when it supplies
a sequence of bytes and a nametype that helps each mechanism
decide how to interpret those bytes.
It is not necessary to create name elements for each available
mechanism at the time the application creates the GSSName. This
implementation does this lazily, as and when name elements for
mechanisms are required to be handed out. (Generally, other GSS
classes like GSSContext and GSSCredential request specific
elements depending on the mechanisms that they are dealing with.)
Assume that getting a mechanism to parse the applciation specified
bytes is an expensive call.
When a GSSName is canonicalized wrt some mechanism, it is supposed
to discard all elements of other mechanisms and retain only the
element for this mechanism. In GSS terminology this is called a
Mechanism Name or MN. This implementation tries to retain the
application provided bytes and name type just in case the MN is
asked to produce an element for a mechanism that is different.
When a GSSName is to be exported, the name element for the desired
mechanism is converted to a byte representation and written
out. It might happen that a name element for that mechanism cannot
be obtained. This happens when the mechanism is just not supported
in this GSS-API or when the mechanism is supported but bytes
corresponding to the nametypes that it understands are not
available in this GSSName.
This class is safe for sharing. Each retrieval of a name element
from getElement() might potentially add a new element to the
hashmap of elements, but getElement() is synchronized.
Summary
|
[Expand]
Inherited Fields |
From interface
org.ietf.jgss.GSSName
|
public
static
final
Oid |
NT_ANONYMOUS |
|
|
public
static
final
Oid |
NT_EXPORT_NAME |
|
|
public
static
final
Oid |
NT_HOSTBASED_SERVICE |
|
|
public
static
final
Oid |
NT_MACHINE_UID_NAME |
|
|
public
static
final
Oid |
NT_STRING_UID_NAME |
|
|
public
static
final
Oid |
NT_USER_NAME |
|
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
From interface
org.ietf.jgss.GSSName
|
abstract
GSSName
|
canonicalize(Oid arg0)
|
|
abstract
boolean
|
equals(Object arg0)
|
|
abstract
boolean
|
equals(GSSName arg0)
|
|
abstract
byte[]
|
export()
|
|
abstract
Oid
|
getStringNameType()
|
|
abstract
int
|
hashCode()
|
|
abstract
boolean
|
isAnonymous()
|
|
abstract
boolean
|
isMN()
|
|
abstract
String
|
toString()
|
|
Fields
private
byte[]
appNameBytes
private
String
appNameStr
private
String
printableName
private
Oid
printableNameType
Public Constructors
public
GSSNameImpl
(GSSManagerImpl gssManager, Object appName, Oid appNameType)
Parameters
| gssManager
| |
| appName
| |
| appNameType
| |
public
GSSNameImpl
(GSSManagerImpl gssManager, Object appName, Oid appNameType, Oid mech)
Parameters
| gssManager
| |
| appName
| |
| appNameType
| |
| mech
| |
Public Methods
public
GSSName
canonicalize
(Oid mech)
public
boolean
equals
(Object another)
public
boolean
equals
(GSSName other)
This method may return false negatives. But if it says two
names are equals, then there is some mechanism that
authenticates them as the same principal.
public
byte[]
export
()
Returns a flat name representation for this object. The name
format is defined in RFC 2743:
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.
Note that it is not required to canonicalize a name before
calling export(). i.e., the name need not be an MN. If it is
not an MN, an implementation defined algorithm can be used for
choosing the mechanism which should export this name.
Returns
- the flat name representation for this object
Throws
| GSSException
| with major codes NAME_NOT_MN, BAD_NAME,
BAD_NAME, FAILURE.
|
public
synchronized
GSSNameSpi
getElement
(Oid mechOid)
public
Oid
getStringNameType
()
public
int
hashCode
()
Returns a hashcode value for this GSSName.
public
boolean
isAnonymous
()
public
String
toString
()