Class SecurityIdentifier


  • public final class SecurityIdentifier
    extends Object
    Class to represent an active directory SID. Provides conversion from binary to string and vice versa.
    • Constructor Detail

      • SecurityIdentifier

        private SecurityIdentifier()
        Default constructor.
    • 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 from
        bigEndian - 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 to
        value - to write
        bigEndian - whether to write the bytes as big endian