Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
protection_descriptor.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 */
33#ifndef API_MIP_PROTECTION_DESCRIPTOR_H_
34#define API_MIP_PROTECTION_DESCRIPTOR_H_
35
36#include <chrono>
37#include <map>
38#include <memory>
39#include <string>
40
41#include "mip/mip_namespace.h"
42#include "mip/user_rights.h"
43#include "mip/user_roles.h"
45
46MIP_NAMESPACE_BEGIN
47
51enum class ProtectionType {
52 TemplateBased = 0,
53 Custom = 1,
54};
55
60struct LabelInfo {
61 LabelInfo(const std::string& _labelId, const std::string& _tenantId) {
62 labelId = _labelId;
63 tenantId = _tenantId;
64 }
65 std::string labelId;
66 std::string tenantId;
67};
68
73public:
74
80 virtual ProtectionType GetProtectionType() const = 0;
81
87 virtual std::string GetOwner() const = 0;
88
94 virtual std::string GetName() const = 0;
95
101 virtual std::string GetDescription() const = 0;
102
108 virtual std::string GetTemplateId() const = 0;
109
118 virtual LabelInfo GetLabelInfo() const = 0;
119
128 virtual std::string GetLabelId() const = 0;
129
138 virtual std::string GetContentId() const = 0;
139
148 virtual std::vector<UserRights> GetUserRights() const = 0;
149
155 virtual std::vector<UserRoles> GetUserRoles() const = 0;
156
162 virtual bool DoesContentExpire() const = 0;
163
169 virtual std::chrono::time_point<std::chrono::system_clock> GetContentValidUntil() const = 0;
170
176 virtual bool DoesAllowOfflineAccess() const = 0;
177
186 virtual std::string GetReferrer() const = 0;
187
196 virtual std::map<std::string, std::string> GetEncryptedAppData() const = 0;
197
206 virtual std::map<std::string, std::string> GetSignedAppData() const = 0;
207
215 virtual std::string GetDoubleKeyUrl() const = 0;
216
222 virtual std::shared_ptr<const std::vector<uint8_t>> GetSerializedTemplate() const = 0;
223
229 virtual std::shared_ptr<const DynamicWatermark> GetDynamicWatermark() const = 0;
230
238 virtual std::string GetSupplementalInfo(const std::string& dataNeeded) const = 0;
239
241 virtual ~ProtectionDescriptor() {}
242protected:
245};
246
247MIP_NAMESPACE_END
248
249#endif //API_MIP_PROTECTION_DESCRIPTOR_H_
Description of protection associated with a piece of content.
Definition protection_descriptor.h:72
virtual std::map< std::string, std::string > GetSignedAppData() const =0
Gets the app-specific data that was signed.
virtual std::map< std::string, std::string > GetEncryptedAppData() const =0
Gets app-specific data that was encrypted.
virtual std::string GetContentId() const =0
Gets the Content ID, if any.
virtual std::shared_ptr< const std::vector< uint8_t > > GetSerializedTemplate() const =0
Gets the serialized template, if any.
virtual std::string GetReferrer() const =0
Gets protection referrer address.
virtual std::string GetDoubleKeyUrl() const =0
Gets the double key url to be used for custom protection.
virtual std::vector< UserRights > GetUserRights() const =0
Gets collection of users-to-rights mappings.
virtual LabelInfo GetLabelInfo() const =0
Gets the label Info, if any.
virtual std::shared_ptr< const DynamicWatermark > GetDynamicWatermark() const =0
Gets the dynamic watermark configured for this content if any.
virtual std::string GetDescription() const =0
Gets protection description.
virtual std::string GetOwner() const =0
Gets owner for the protection.
virtual std::string GetSupplementalInfo(const std::string &dataNeeded) const =0
Get supplemental information associated with this ProtectionDescriptor.
virtual std::string GetLabelId() const =0
Gets the label ID, if any.
virtual std::chrono::time_point< std::chrono::system_clock > GetContentValidUntil() const =0
Gets protection expiration time.
virtual std::string GetTemplateId() const =0
Gets the protection template ID, if any.
virtual ProtectionType GetProtectionType() const =0
Gets type of protection, whether it originated from protection SDK template or not.
virtual bool DoesContentExpire() const =0
Checks if content has an expiration time or not.
virtual std::vector< UserRoles > GetUserRoles() const =0
Gets collection of users-to-roles mappings.
virtual bool DoesAllowOfflineAccess() const =0
Gets if protection allows offline content access or not.
virtual std::string GetName() const =0
Gets protection name.
Defines DynamicWatermark interface.
MIP namespace macros.
ProtectionType
Describes whether protection is based off a template or ad-hoc (custom)
Definition protection_descriptor.h:51
Label information for a template or ad-hoc (custom) protection.
Definition protection_descriptor.h:60
LabelInfo(const std::string &_labelId, const std::string &_tenantId)
Definition protection_descriptor.h:61
std::string labelId
Definition protection_descriptor.h:65
std::string tenantId
Definition protection_descriptor.h:66
Defines UserRights class.
Defines UserRoles class.