s4:dsdb: Add functions for Group Managed Service Accounts implementation
[samba.git] / source4 / dsdb / gmsa / gkdi.h
blob4c5394167fd4a9faa8b1e0e49935a49549ee734a
1 /*
2 Unix SMB/CIFS implementation.
3 Group Key Distribution Protocol functions
5 Copyright (C) Catalyst.Net Ltd 2024
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <https://www.gnu.org/licenses/>.
21 #ifndef DSDB_GMSA_GKDI_H
22 #define DSDB_GMSA_GKDI_H
24 #include <talloc.h>
25 #include "lib/util/data_blob.h"
26 #include "lib/util/time.h"
27 #include "libcli/util/ntstatus.h"
28 #include "librpc/gen_ndr/misc.h"
30 struct ldb_message;
31 struct ProvRootKey;
32 NTSTATUS gkdi_root_key_from_msg(TALLOC_CTX *mem_ctx,
33 const struct GUID root_key_id,
34 const struct ldb_message *const msg,
35 const struct ProvRootKey **const root_key_out);
38 * Calculate an appropriate useStartTime for a root key created at
39 * ‘current_time’.
41 * This function goes unused.
43 NTTIME gkdi_root_key_use_start_time(const NTTIME current_time);
46 * Create and return a new GKDI root key.
48 * This function goes unused.
50 struct ldb_context;
51 int gkdi_new_root_key(TALLOC_CTX *mem_ctx,
52 struct ldb_context *const ldb,
53 const NTTIME current_time,
54 const NTTIME use_start_time,
55 struct GUID *const root_key_id_out,
56 const struct ldb_message **const root_key_out);
58 int gkdi_root_key_from_id(TALLOC_CTX *mem_ctx,
59 struct ldb_context *const ldb,
60 const struct GUID *const root_key_id,
61 const struct ldb_message **const root_key_out);
63 int gkdi_most_recently_created_root_key(
64 TALLOC_CTX *mem_ctx,
65 struct ldb_context *const ldb,
66 const NTTIME current_time,
67 const NTTIME not_after,
68 struct GUID *const root_key_id_out,
69 const struct ldb_message **const root_key_out);
71 #endif /* DSDB_GMSA_GKDI_H */