Package org.ldaptive.ad
Class SecurityIdentifier
java.lang.Object
org.ldaptive.ad.SecurityIdentifier
Class to represent an active directory SID. Provides conversion from binary to string and vice versa.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static long
getLong
(ByteBuffer buffer, boolean bigEndian) Reads a long from the supplied byte buffer.private static void
putLong
(ByteBuffer buffer, long value, boolean bigEndian) Writes a long into the supplied byte buffer.static byte[]
Converts the supplied SID to it's binary format.static String
toString
(byte[] sid) Converts the supplied SID to it's string format.
-
Constructor Details
-
SecurityIdentifier
private SecurityIdentifier()Default constructor.
-
-
Method Details
-
toString
Converts the supplied SID to it's string format.- Parameters:
sid
- to convert- Returns:
- string format of the SID
-
toBytes
Converts the supplied SID to it's binary format.- Parameters:
sid
- to convert- Returns:
- binary format of the SID
-
getLong
Reads a long from the supplied byte buffer. The byte buffer limit must be set appropriately by the caller.- Parameters:
buffer
- to read long frombigEndian
- whether to read the bytes as big endian- Returns:
- long value
-
putLong
Writes a long into the supplied byte buffer. The byte buffer limit must be set appropriately by the caller.- Parameters:
buffer
- to write long tovalue
- to writebigEndian
- whether to write the bytes as big endian
-