summaryrefslogtreecommitdiff
path: root/sid.mli
blob: 23c4a71b85983df235d89378e5b3affa78c81ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(* SPDX-License-Identifier: LGPL-3.0-only *)

type t
type sub_auths = Stdint.Uint32.t array
val create_unsafe : Stdint.Uint32.t array -> Stdint.Uint64.t -> t
val create : ?sa:Stdint.Uint32.t array -> Stdint.Uint64.t -> t
val equal_sub_auths : Stdint.Uint32.t array -> Stdint.Uint32.t array -> bool
val equal : t -> t -> bool
val get_ident_auth : t -> Stdint.Uint64.t
val get_sub_auths : t -> sub_auths

module StringFmt :
  sig
    val decode : string -> (t, string result)
    val encode : t -> string
  end

module PacketRep :
  sig
    type endian = Big | Little
    val encode : ?endian:endian -> t -> bytes
    val decode : ?endian:endian -> bytes -> (t, string) result
  end

module WellKnown :
  sig
    val null : t
    val everyone : t
    val world : t
    val local : t
    val creator_owner_id : t
    val creator_group_id : t
    val elite : t

    module Prefix :
      sig
        type toplevel_auth = ?sa:sub_auths -> unit -> t

        val security_null_sid_authority    : toplevel_auth
        val security_world_sid_authority   : ?sa:sub_auths -> unit -> t
        val security_local_sid_authority   : ?sa:sub_auths -> unit -> t
        val security_creator_sid_authority : ?sa:sub_auths -> unit -> t
        val security_nt_authority          : ?sa:sub_auths -> unit -> t
        val security_app_package_authority      : ?sa:sub_auths -> unit -> t
        val security_mandatory_label_authority  : ?sa:sub_auths -> unit -> t
        val security_scoped_policy_id_authority : ?sa:sub_auths -> unit -> t
        val security_authentication_authority   : ?sa:sub_auths -> unit -> t
      end
  end

val of_string : string -> t
val to_string : t -> string