package sid

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Security identifiers.

Sid implements the “Security Identifier” data type commonly used on the Microsoft Windows platform. When processing input, it tries to adhere as closely to the specification as possible. Optionally, a special mode for the text representation is available as the MSStringFmt module which aims to be bug-for-bug compatible with the official implementation. There is no such mode for the two identical binary representations due to the fact that they don’t leave room for ambiguity.

type t
type sub_auths = Stdint.Uint32.t array
val create : Stdint.Uint64.t -> Stdint.Uint32.t array -> t option

create sas ia constructs a SID with the identifier authority ia and the subauthorities sas. The operation will return None if sa contains either zero or more than fifteen subauthorities, or if ia exceeds 48 bits.

val create_unsafe : Stdint.Uint64.t -> Stdint.Uint32.t array -> t

create_unsafe sas ia constructs a SID with the identifier authority ia and the sub authorities sas without validating the inputs. Use with caution.

val equal : t -> t -> bool

equal sa sb tests whether sa and sb are identical.

val equal_sub_auths : Stdint.Uint32.t array -> Stdint.Uint32.t array -> bool

equal_sub_auths sa sb tests whether sa and sb have identical subauthorities.

val get_ident_auth : t -> Stdint.Uint64.t

get_ident_auth s get the identifier authority of SID s.

val get_sub_auths : t -> sub_auths

get_ident_auth s get the subauthorities array of SID s.

module StringFmt : sig ... end

Conversions to and from the string format syntax (MS-DTYP 2.4.2.1).

module MSStringFmt : sig ... end

Conversions to and from the string format syntax with permissive input validation.

module PacketRep : sig ... end

Conversion to and from the packet representation (MS-DTYP 2.4.2.2).

module WellKnown : sig ... end

Pre-defined SID constants and constructors with fixed identifier authority (MS-DTYP 2.4.2.4).

val of_string : string -> (t, string) result

of_string b is an alias for StringFmt.decode b.

val to_string : t -> string

to_string s is an alias for StringFmt.encode s.

val of_bytes : ?endian:PacketRep.endian -> bytes -> (t, string) result

of_bytes endian b is an alias for PacketRep.decode endian b.

val to_bytes : ?endian:PacketRep.endian -> t -> bytes

to_bytes endian b is an alias for PacketRep.encode endian b.

OCaml

Innovation. Community. Security.