Compoze Software, Inc.

com.compoze.util
Class Win32Sid


java.lang.Object

  |

  +--com.compoze.util.Win32Sid


public class Win32Sid
extends java.lang.Object

This class provides methods to look up Windows 32 security identifiers from account names, and account names from security identifiers. This class:


Field Summary
static java.lang.String USAGE
           
 
Constructor Summary
Win32Sid()
          Constructor.
 
Method Summary
 java.lang.String getAccount(byte[] sid)
          Gets an account (in the form DOMAIN\Username) from a SID.
 java.lang.String getAccount(java.lang.String sSID)
          Gets an account (in the form DOMAIN\Username) from a SID.
 java.lang.String getAccount(java.lang.String sSystemName, byte[] sid)
          Gets an account (in the form DOMAIN\Username) from a SID.
 java.lang.String getAccount(java.lang.String sSystemName, java.lang.String sSID)
          Gets an account (in the form DOMAIN\Username) from a SID.
 byte[] getSid(java.lang.String sAccount)
          Gets a SID from a domain name and username.
 byte[] getSid(java.lang.String sSystemName, java.lang.String sAccount)
          Gets a SID from a domain name and username.
 java.lang.String getSidAsString(java.lang.String sAccount)
          Gets a SID from a domain name and username.
 java.lang.String getSidAsString(java.lang.String sSystemName, java.lang.String sAccount)
          Gets a SID from a domain name and username.
static Win32Sid i()
          Gets the singleton instance of this class.
static void main(java.lang.String[] args)
          Main.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USAGE


public static final java.lang.String USAGE
Constructor Detail

Win32Sid


public Win32Sid()
Constructor.
Method Detail

i


public static Win32Sid i()
Gets the singleton instance of this class.
Returns:
the singleton instance

getSid


public byte[] getSid(java.lang.String sSystemName,
                     java.lang.String sAccount)
Gets a SID from a domain name and username.
Parameters:
sSystemName - the system to look up the SID on (or null to use the local system)
sAccount - the account name (in the form DOMAIN\Username)
Returns:
the SID, or null if it could not be found

getSid


public byte[] getSid(java.lang.String sAccount)
Gets a SID from a domain name and username.
Parameters:
sAccount - the account name (in the form DOMAIN\Username)
Returns:
the SID, or null if it could not be found

getSidAsString


public java.lang.String getSidAsString(java.lang.String sSystemName,
                                       java.lang.String sAccount)
Gets a SID from a domain name and username.
Parameters:
sSystemName - the system to look up the SID on (or null to use the local system)
sAccount - the account name (in the form DOMAIN\Username)
Returns:
the SID in a hex string, or null if it could not be found

getSidAsString


public java.lang.String getSidAsString(java.lang.String sAccount)
Gets a SID from a domain name and username.
Parameters:
sAccount - the account name (in the form DOMAIN\Username)
Returns:
the SID in a hex string, or null if it could not be found

getAccount


public java.lang.String getAccount(java.lang.String sSystemName,
                                   byte[] sid)
Gets an account (in the form DOMAIN\Username) from a SID.
Parameters:
sSystemName - the system to look up the SID on (or null to use the local system)
sid - the SID to get the account for
Returns:
the account (in the form DOMAIN\Username) in a hex string, or null if it could not be found

getAccount


public java.lang.String getAccount(byte[] sid)
Gets an account (in the form DOMAIN\Username) from a SID.
Parameters:
sid - the SID to get the account for
Returns:
the account (in the form DOMAIN\Username) in a hex string, or null if it could not be found

getAccount


public java.lang.String getAccount(java.lang.String sSystemName,
                                   java.lang.String sSID)
Gets an account (in the form DOMAIN\Username) from a SID.
Parameters:
sSystemName - the system to look up the SID on (or null to use the local system)
sSID - the SID to get the account for (in hex string)
Returns:
the account (in the form DOMAIN\Username) in a hex string, or null if it could not be found

getAccount


public java.lang.String getAccount(java.lang.String sSID)
Gets an account (in the form DOMAIN\Username) from a SID.
Parameters:
sSID - the SID to get the account for (in hex string)
Returns:
the account (in the form DOMAIN\Username) in a hex string, or null if it could not be found

main


public static void main(java.lang.String[] args)
Main.

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.