Microsoft Information Protection (MIP) SDK for C: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C
Loading...
Searching...
No Matches
protection_descriptor_builder_cc.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief Defines C-Style ProtectionDescriptorBuilder interface
29 *
30 * @file protection_descriptor_builder_cc.h
31 */
32
33#ifndef API_MIP_PROTECTION_DESCRIPTOR_BUILDER_CC_H_
34#define API_MIP_PROTECTION_DESCRIPTOR_BUILDER_CC_H_
35
37
39
40typedef enum {
41 MIP_PROTECTION_LICENSE_TYPE_DO_NOT_FORWARD = 0, /**< Defines a Do Not Forward License */
42 MIP_PROTECTION_LICENSE_TYPE_ENCRYPT_ONLY = 1, /**< Defines an Encrypt Only License */
44
45/**
46 * @brief Creates a protection descriptor whose access permissions are defined by users and rights
47 *
48 * @param userRights Groups of users and their rights
49 * @param userRightsCount Number of user/rights groups
50 * @param protectionDescriptorBuilder [Output] Newly-created protection descriptor builder instance
51 * @param errorInfo [Output] (Optional) Failure info if operation result is error
52 *
53 * @return Result code indicating success or failure
54 */
55MIP_CC_API(mip_cc_result) MIP_CC_CreateProtectionDescriptorBuilderFromUserRights(
57 const int64_t userRightsCount,
60
61/**
62 * @brief Creates a protection descriptor builder whose access permissions are defined by users and roles
63 *
64 * @param userRoles Groups of users and their roles
65 * @param userRolesCount Number of user/roles groups
66 * @param protectionDescriptorBuilder [Output] Newly-created protection descriptor builder instance
67 * @param errorInfo [Output] (Optional) Failure info if operation result is error
68 *
69 * @return Result code indicating success or failure
70 */
71MIP_CC_API(mip_cc_result) MIP_CC_CreateProtectionDescriptorBuilderFromUserRoles(
73 const int64_t userRolesCount,
76
77/**
78 * @brief Creates a protection descriptor builder whose access permissions are defined by an RMS template
79 *
80 * @param templateId Template ID in GUID format
81 * @param protectionDescriptorBuilder [Output] Newly-created protection descriptor builder instance
82 * @param errorInfo [Output] (Optional) Failure info if operation result is error
83 *
84 * @return Result code indicating success or failure
85 */
86MIP_CC_API(mip_cc_result) MIP_CC_CreateProtectionDescriptorBuilderFromTemplate(
87 const char* templateId,
90
91/**
92 * @brief Creates a protection descriptor builder based on an existing protection descriptor
93 *
94 * @param protectionDescriptor The protection descriptor to base this builder on
95 * @param protectionDescriptorBuilder [Output] Newly-created protection descriptor builder instance
96 * @param errorInfo [Output] (Optional) Failure info if operation result is error
97 *
98 * @return Result code indicating success or failure
99 */
100MIP_CC_API(mip_cc_result) MIP_CC_CreateProtectionDescriptorBuilderFromProtectionDescriptor(
104
105/**
106 * @brief Creates a ProtectionDescriptorBuilder for a license type with the specified users
107 *
108 * @param licenseType The license type to create this Protection Descriptor Builder for
109 * @param usersWithDefaultRights Collection of users to add to the license with default rights for the specific type
110 * @param usersWithDefaultRightsCount Number of users in the usersWithDefaultRights array
111 * @param additionalUsersAndRights Optional additional collection of users-to-rights mappings
112 * @param additionalUsersAndRightsCount Number of users in the additionalUsersAndRights array
113 * @param protectionDescriptorBuilder [Output] Newly-created protection descriptor builder instance
114 * @param errorInfo [Output] (Optional) Failure info if operation result is error
115 *
116 * @return Result code indicating success or failure
117 */
118MIP_CC_API(mip_cc_result) MIP_CC_CreateProtectionDescriptorBuilderFromLicenseType(
126
127/**
128 * @brief Creates a Protection Descriptor Builder whose access permissions are defined by the protection template
129 *
130 * @param serializedTemplate Protection template
131 * @param serializedTemplateSize Size of the serialized template
132 * @param protectionDescriptorBuilder [Output] Newly-created protection descriptor builder instance
133 * @param errorInfo [Output] (Optional) Failure info if operation result is error
134 *
135 * @return Result code indicating success or failure
136 */
137MIP_CC_API(mip_cc_result) MIP_CC_CreateProtectionDescriptorBuilderFromSerializedTemplate(
138 const uint8_t* serializedTemplate,
142
143/**
144 * @brief Build a protection descriptor from the protection descriptor builder
145 *
146 * @param protectionDescriptorBuilder Protection descriptor builder
147 * @param protectionDescriptor [Output] Newly-created protection descriptor instance
148 * @param errorInfo [Output] (Optional) Failure info if operation result is error
149 *
150 * @return Result code indicating success or failure
151 */
152MIP_CC_API(mip_cc_result) MIP_CC_BuildProtectionDescriptor(
156
157/**
158 * @brief Set the name of the protection
159 *
160 * @param protectionDescriptorBuilder Protection descriptor builder
161 * @param name Protection name
162 * @param errorInfo [Output] (Optional) Failure info if operation result is error
163 *
164 * @return Result code indicating success or failure
165 */
166MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetName(
168 const char* name,
170
171/**
172 * @brief Set the description of the protection
173 *
174 * @param protectionDescriptorBuilder Protection descriptor builder
175 * @param description Protection description
176 * @param errorInfo [Output] (Optional) Failure info if operation result is error
177 *
178 * @return Result code indicating success or failure
179 */
180MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetDescription(
182 const char* description,
184
185/**
186 * @brief Sets protection expiration time (in seconds since epoch)
187 *
188 * @param protectionDescriptor Descriptor associated with protected content
189 * @param contentValidUntil Content expiration time (in seconds since epoch)
190 * @param errorInfo [Output] (Optional) Failure info if operation result is error
191 *
192 * @return Result code indicating success or failure
193 */
194MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetContentValidUntil(
198
199
200/**
201 * @brief Sets if protection policy allows offline content access or not
202 *
203 * @param protectionDescriptorBuilder Protection descriptor builder
204 * @param allowOfflineAccess If policy allows offline content access or not
205 * @param errorInfo [Output] (Optional) Failure info if operation result is error
206 *
207 */
208MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetAllowOfflineAccess(
212
213/**
214 * @brief Sets the protection referrer email address
215 *
216 * @param protectionDescriptorBuilder Protection descriptor builder
217 * @param uri Address to referrer unauthenticated users to
218 * @param errorInfo [Output] (Optional) Failure info if operation result is error
219 *
220 * @return Result code indicating success or failure
221 */
222MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetReferrer(
224 const char* uri,
226
227/**
228 * @brief Sets the encrypted application data for the protection
229 *
230 * @param protectionDescriptorBuilder Protection descriptor builder
231 * @param appData Application-specific data to encrypt
232 * @param errorInfo [Output] (Optional) Failure info if operation result is error
233 *
234 * @return Result code indicating success or failure
235 */
236MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetEncryptedAppData(
240
241/**
242 * @brief Sets the signed application data for the protection
243 *
244 * @param protectionDescriptorBuilder Protection descriptor builder
245 * @param appData Application-specific data for unencrypted section
246 * @param errorInfo [Output] (Optional) Failure info if operation result is error
247 *
248 * @return Result code indicating success or failure
249 */
250MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetSignedAppData(
254
255/**
256 * @brief Sets a double key url for custom protection
257 *
258 * @param protectionDescriptorBuilder Protection descriptor builder
259 * @param doubleKeyUrl Double key url
260 * @param errorInfo [Output] (Optional) Failure info if operation result is error
261 *
262 * @return Result code indicating success or failure
263 */
264MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetDoubleKeyUrl(
266 const char* doubleKeyUrl,
268
269/**
270 * @brief Sets the label information for UDP protection
271 *
272 * @param protectionDescriptorBuilder Protection descriptor builder
273 * @param labelId Label ID
274 * @param tenantId Tenant ID
275 * @param errorInfo [Output] (Optional) Failure info if operation result is error
276 *
277 * @return Result code indicating success or failure
278 */
279MIP_CC_API(mip_cc_result) MIP_CC_ProtectionDescriptorBuilder_SetLabelInfo(
281 const char* labelId,
282 const char* tenantId,
284
285/**
286 * @brief Release resources associated with a protection descriptor builder
287 *
288 * @param protectionDescriptorBuilder Protection descriptor builder to be released
289 */
290MIP_CC_API(void) MIP_CC_ReleaseProtectionDescriptorBuilder(mip_cc_protection_descriptor_builder protectionDescriptorBuilder);
291
292#endif // API_MIP_PROTECTION_DESCRIPTOR_BUILDER_CC_H_
@ MIP_PROTECTION_LICENSE_TYPE_ENCRYPT_ONLY
Defines an Encrypt Only License.
@ MIP_PROTECTION_LICENSE_TYPE_DO_NOT_FORWARD
Defines a Do Not Forward License.
const char const int64_t usersWithDefaultRightsCount
const int64_t mip_cc_protection_descriptor_builder mip_cc_error * errorInfo
const int64_t serializedTemplateSize
const char ** usersWithDefaultRights
const char * doubleKeyUrl
const char * description
const int64_t userRightsCount
const char * name
const int64_t mip_cc_protection_descriptor_builder * protectionDescriptorBuilder
const char const int64_t const mip_cc_user_rights * additionalUsersAndRights
mip_cc_handle * mip_cc_protection_descriptor_builder
mip_cc_protection_descriptor * protectionDescriptor
const mip_cc_dictionary appData
const int64_t userRolesCount
const char const int64_t const mip_cc_user_rights const int64_t additionalUsersAndRightsCount
MIP_CC_API(void) MIP_CC_ReleaseProtectionDescriptorBuilder(mip_cc_protection_descriptor_builder protectionDescriptorBuilder)
Release resources associated with a protection descriptor builder.
const char * labelId
const char const char * tenantId
Defines C-Style ProtectionDescriptor interface.
mip_cc_user_rights_result * userRights
mip_cc_user_roles_result * userRoles
mip_cc_result
API success/failure result.
Definition result_cc.h:44
Error information.
Definition error_cc.h:79
Opaque handle to MIP object.
A group of users and the rights associated with them.
A group of users and the roles associated with them.
mip_cc_guid * templateId