public class SID extends rpc.sid_t implements SID
Consider the following output of examples/SidLookup.java:
toString: S-1-5-21-4133388617-793952518-2001621813-512 toDisplayString: WNET\Domain Admins getType: 2 getTypeText: Domain group getDomainName: WNET getAccountName: Domain Admins
Modifier and Type | Field and Description |
---|---|
static SID |
CREATOR_OWNER
Well known SID: CREATOR_OWNER
|
static SID |
EVERYONE
Well known SID: EVERYONE
|
static int |
SID_FLAG_RESOLVE_SIDS |
static SID |
SYSTEM
Well known SID: SYSTEM
|
identifier_authority, revision, sub_authority, sub_authority_count
SID_TYPE_ALIAS, SID_TYPE_DELETED, SID_TYPE_DOM_GRP, SID_TYPE_DOMAIN, SID_TYPE_INVALID, SID_TYPE_UNKNOWN, SID_TYPE_USE_NONE, SID_TYPE_USER, SID_TYPE_WKN_GRP
Constructor and Description |
---|
SID(byte[] src,
int si)
Construct a SID from it's binary representation.
|
SID(rpc.sid_t sid,
int type,
String domainName,
String acctName,
boolean decrementAuthority) |
SID(SID domsid,
int rid)
Construct a SID from a domain SID and an RID
(relative identifier).
|
SID(SID domsid,
SID id)
Construct a relative SID
|
SID(String textual)
Construct a SID from it's textual representation such as
S-1-5-21-1496946806-2192648263-3843101252-1029.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getAccountName()
Return the sAMAccountName of this SID unless it could not
be resolved in which case the numeric RID is returned.
|
String |
getDomainName()
Return the domain name of this SID unless it could not be
resolved in which case the numeric representation is returned.
|
SID |
getDomainSid() |
SID[] |
getGroupMemberSids(String authorityServerName,
CIFSContext tc,
int flags)
Get members of the group represented by this SID, if it is one.
|
int |
getRid()
Get the RID
This is the last subauthority identifier
|
int |
getType()
Returns the type of this SID indicating the state or type of account.
|
String |
getTypeText()
Return text represeting the SID type suitable for display to
users.
|
int |
hashCode() |
boolean |
isBlank() |
boolean |
isEmpty() |
void |
resolve(String authorityServerName,
CIFSContext tc)
Manually resolve this SID.
|
byte[] |
toByteArray() |
static byte[] |
toByteArray(rpc.sid_t sid)
Convert a sid_t to byte array
|
String |
toDisplayString()
Return a String representing this SID ideal for display to
users.
|
String |
toString()
Return the numeric representation of this sid such as
S-1-5-21-1496946806-2192648263-3843101252-1029.
|
<T> T |
unwrap(Class<T> t) |
public static final int SID_FLAG_RESOLVE_SIDS
public static SID EVERYONE
public static SID CREATOR_OWNER
public static SID SYSTEM
public SID(byte[] src, int si)
src
- si
- public SID(String textual) throws SmbException
textual
- SmbException
public SID(SID domsid, int rid)
domsid
- rid
- public static byte[] toByteArray(rpc.sid_t sid)
sid
- public <T> T unwrap(Class<T> t)
unwrap
in interface SID
SID.unwrap(java.lang.Class)
public byte[] toByteArray()
public boolean isEmpty()
public boolean isBlank()
public SID getDomainSid()
getDomainSid
in interface SID
public int getRid()
public int getType()
SID
SID types are described in the following table.
Type | Name |
---|---|
SID_TYPE_USE_NONE | 0 |
SID_TYPE_USER | User |
SID_TYPE_DOM_GRP | Domain group |
SID_TYPE_DOMAIN | Domain |
SID_TYPE_ALIAS | Local group |
SID_TYPE_WKN_GRP | Builtin group |
SID_TYPE_DELETED | Deleted |
SID_TYPE_INVALID | Invalid |
SID_TYPE_UNKNOWN | Unknown |
public String getTypeText()
SID
getTypeText
in interface SID
public String getDomainName()
SID
getDomainName
in interface SID
public String getAccountName()
SID
getAccountName
in interface SID
public String toString()
public String toDisplayString()
SID
Specifically, if the SID has been resolved and it is not a domain SID or builtin account, the full DOMAIN\name form of the account will be returned (e.g. MYDOM\alice or MYDOM\Domain Users). If the SID has been resolved but it is is a domain SID, only the domain name will be returned (e.g. MYDOM). If the SID has been resolved but it is a builtin account, only the name component will be returned (e.g. SYSTEM). If the sid cannot be resolved the numeric representation from toString() is returned.
toDisplayString
in interface SID
public void resolve(String authorityServerName, CIFSContext tc) throws IOException
authorityServerName
- The FQDN of the server that is an authority for the SID.tc
- Context to useIOException
public SID[] getGroupMemberSids(String authorityServerName, CIFSContext tc, int flags) throws IOException
authorityServerName
- tc
- flags
- IOException
Copyright © 2017. All rights reserved.