Package org.ldaptive.ad
Class SecurityIdentifier
- java.lang.Object
-
- org.ldaptive.ad.SecurityIdentifier
-
public final class SecurityIdentifier extends Object
Class to represent an active directory SID. Provides conversion from binary to string and vice versa.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SecurityIdentifier()
Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private 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[]
toBytes(String sid)
Converts the supplied SID to its binary format.static String
toString(byte[] sid)
Converts the supplied SID to its string format.
-
-
-
Method Detail
-
toString
public static String toString(byte[] sid)
Converts the supplied SID to its string format.- Parameters:
sid
- to convert- Returns:
- string format of the SID
-
toBytes
public static byte[] toBytes(String sid)
Converts the supplied SID to its binary format.- Parameters:
sid
- to convert- Returns:
- binary format of the SID
-
getLong
private static long getLong(ByteBuffer buffer, boolean bigEndian)
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
private static void putLong(ByteBuffer buffer, long value, boolean bigEndian)
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
-
-