APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.security.auth

public Class NTSid

extends Object
implements Principal, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.security.Principal
Known Direct Subclasses
com.sun.security.auth.NTSidDomainPrincipal, com.sun.security.auth.NTSidGroupPrincipal, com.sun.security.auth.NTSidPrimaryGroupPrincipal, com.sun.security.auth.NTSidUserPrincipal
Imports
java.io.IOException, .InvalidObjectException, .ObjectInputStream, java.security.Principal

This class implements the Principal interface and represents information about a Windows NT user, group or realm.

Windows NT chooses to represent users, groups and realms (or domains) with not only common names, but also relatively unique numbers. These numbers are called Security IDentifiers, or SIDs. Windows NT also provides services that render these SIDs into string forms. This class represents these string forms.

Principals such as this NTSid may be associated with a particular Subject to augment that Subject with an additional identity. Refer to the Subject class for more information on how to achieve this. Authorization decisions can then be based upon the Principals associated with a Subject.

Since
1.4
See Also
java.security.Principal, javax.security.auth.Subject

Field Summary

Modifier and TypeField and Description
private static final long
private String

Constructor Summary

AccessConstructor and Description
public
NTSid(String
the Windows NT SID.
stringSid
)

Create an NTSid with a Windows NT SID.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the specified Object is equal to this NTSid.
equals
(Object
Object to be compared for equality with this NTSid.
o
)

Overrides java.lang.Object.equals.

Implements java.security.Principal.equals.

Compares the specified Object with this NTSid for equality.

public String

Returns:

a string version of this NTSid
getName
()

Implements java.security.Principal.getName.

Return a string version of this NTSid.

public int

Returns:

a hash code for this NTSid.
hashCode
()

Overrides java.lang.Object.hashCode.

Implements java.security.Principal.hashCode.

Return a hash code for this NTSid.

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
stream
)

Restores the state of this object from the stream.

public String

Returns:

a string representation of this NTSid.
toString
()

Overrides java.lang.Object.toString.

Implements java.security.Principal.toString.

Return a string representation of this NTSid.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID
Annotations
@Serial
sidback to summary
private String sid

Constructor Detail

NTSidback to summary
public NTSid(String stringSid)

Create an NTSid with a Windows NT SID.

Parameters
stringSid:String

the Windows NT SID.

Exceptions
NullPointerException:
if the String is null.
IllegalArgumentException:
if the String has zero length.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.security.Principal.equals.

Compares the specified Object with this NTSid for equality. Returns true if the given object is also a NTSid and the two NTSids have the same String representation.

Parameters
o:Object

Object to be compared for equality with this NTSid.

Returns:boolean

true if the specified Object is equal to this NTSid.

getNameback to summary
public String getName()

Implements java.security.Principal.getName.

Return a string version of this NTSid.

Returns:String

a string version of this NTSid

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.security.Principal.hashCode.

Return a hash code for this NTSid.

Returns:int

a hash code for this NTSid.

readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Restores the state of this object from the stream.

Parameters
stream:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.security.Principal.toString.

Return a string representation of this NTSid.

Returns:String

a string representation of this NTSid.