Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
protection_engine.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_PROTECTION_ENGINE_H_
34#define API_MIP_PROTECTION_PROTECTION_ENGINE_H_
35
36#include <chrono>
37#include <climits>
38#include <memory>
39#include <string>
40#include <vector>
41
42#include "mip/common_types.h"
43#include "mip/error.h"
44#include "mip/mip_export.h"
45#include "mip/mip_namespace.h"
56
59namespace {
60
61const int kMinTemplateBatchNum = 1; // 1 template per request (many operations in parallel, small packets)
62const int kMaxTemplateBatchNum = 25; // 25 templates per request (fewer operations in parallel, larger packets)
63
64} //namespace
65
69MIP_NAMESPACE_BEGIN
70
75public:
81 class Observer {
82 public:
94 const std::vector<std::shared_ptr<TemplateDescriptor>>& templateDescriptors,
95 const std::shared_ptr<void>& context) { UNUSED(templateDescriptors); UNUSED(context); }
96
108 const std::exception_ptr& error,
109 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
110
122 const std::shared_ptr<std::vector<std::string>>& rights,
123 const std::shared_ptr<void>& context) { UNUSED(rights); UNUSED(context); }
124
136 const std::exception_ptr& error,
137 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
138
149 const std::shared_ptr<void>& context) { UNUSED(context); }
150
162 const std::exception_ptr& error,
163 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
164
175 const std::shared_ptr<void>& context) { UNUSED(context); }
176
188 const std::exception_ptr& error,
189 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
190
201 const std::shared_ptr<void>& context) { UNUSED(context); }
202
214 const std::exception_ptr& error,
215 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
216
227 std::vector<std::shared_ptr<DelegationLicense>> delegatedLicenses,
228 const std::shared_ptr<void>& context) { UNUSED(delegatedLicenses); UNUSED(context); }
229
241 const std::exception_ptr& error,
242 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
243
254 const std::shared_ptr<TenantInformation>& tenantInformation,
255 const std::shared_ptr<void>& context) { UNUSED(tenantInformation); UNUSED(context); }
256
268 const std::exception_ptr& error,
269 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
270
282 const std::shared_ptr<LicenseRightsData>& licenseRightsData,
283 const std::shared_ptr<void>& context) { UNUSED(licenseRightsData); UNUSED(context); }
284
296 const std::exception_ptr& error,
297 const std::shared_ptr<void>& context) { UNUSED(error); UNUSED(context); }
298
300 virtual ~Observer() { }
301 protected:
302 Observer() { }
304 };
305
309 class Settings {
310 public:
323 const Identity& identity,
324 const std::shared_ptr<AuthDelegate>& authDelegate,
325 const std::string& clientData,
326 const std::string& locale = "")
327 : mIdentity(identity),
328 mAuthDelegate(authDelegate),
329 mClientData(clientData),
330 mLocale(locale),
331 mAllowCloudServiceOnly(false),
332 mTemplateRefreshRate(std::chrono::hours::zero()),
333 mTemplateBatchSize(kMaxTemplateBatchNum) {
334 if (mLocale.compare("") == 0) {
335 mLocale = "en-US";
336 }
337 }
338
351 const std::string& engineId,
352 const std::shared_ptr<AuthDelegate>& authDelegate,
353 const std::string& clientData,
354 const std::string& locale = "")
355 : mEngineId(engineId),
356 mAuthDelegate(authDelegate),
357 mClientData(clientData),
358 mLocale(locale),
359 mAllowCloudServiceOnly(false),
360 mTemplateRefreshRate(std::chrono::hours::zero()),
361 mTemplateBatchSize(kMaxTemplateBatchNum) {
362 if (mLocale.compare("") == 0) {
363 mLocale = "en-US";
364 }
365 }
366
372 const std::string& GetEngineId() const { return mEngineId; }
373
379 void SetEngineId(const std::string& engineId) { mEngineId = engineId; }
380
386 const Identity& GetIdentity() const { return mIdentity; }
387
393 void SetIdentity(const Identity& identity) { mIdentity = identity; }
394
400 const std::string& GetClientData() const { return mClientData; }
401
407 void SetClientData(const std::string& clientData) { mClientData = clientData; }
408
414 const std::string& GetLocale() const { return mLocale; }
415
421 void SetCustomSettings(const std::vector<std::pair<std::string, std::string>>& value) { mCustomSettings = value; }
422
428 const std::vector<std::pair<std::string, std::string>>& GetCustomSettings() const { return mCustomSettings; }
429
435 void SetSessionId(const std::string& sessionId) {
436 mSessionId = sessionId;
437 }
438
444 const std::string& GetSessionId() const {
445 return mSessionId;
446 }
447
456 void SetCloud(Cloud cloud) {
457 mCloud = cloud;
458 }
459
465 Cloud GetCloud() const {
466 return mCloud;
467 }
468
476 void SetDataBoundary(DataBoundary dataBoundary) {
477 mDataBoundary = dataBoundary;
478 }
479
486 return mDataBoundary;
487 }
488
496 void SetCloudEndpointBaseUrl(const std::string& cloudEndpointBaseUrl) {
497 mCloudEndpointBaseUrl = cloudEndpointBaseUrl;
498 }
499
505 const std::string& GetCloudEndpointBaseUrl() const {
506 return mCloudEndpointBaseUrl;
507 }
508
514 void SetAuthDelegate(const std::shared_ptr<AuthDelegate>& authDelegate) {
515 mAuthDelegate = authDelegate;
516 }
517
523 std::shared_ptr<AuthDelegate> GetAuthDelegate() const { return mAuthDelegate; }
524
530 const std::string& GetUnderlyingApplicationId() const { return mUnderlyingApplicationId; }
531
537 void SetUnderlyingApplicationId(const std::string& underlyingApplicationId) { mUnderlyingApplicationId = underlyingApplicationId; }
538
544 bool GetAllowCloudServiceOnly() const { return mAllowCloudServiceOnly; }
545
551 void SetAllowCloudServiceOnly(bool allowCloudServiceOnly) { mAllowCloudServiceOnly = allowCloudServiceOnly; }
552
560 std::chrono::hours GetTemplateRefreshInterval() const { return mTemplateRefreshRate; }
561
567 int GetTemplateBatchSize() const { return mTemplateBatchSize; }
568
582 void SetTemplateRefreshArgs(std::chrono::hours templateRefreshRateHours, int templateBatchSize = kMaxTemplateBatchNum) {
583 if (templateRefreshRateHours < std::chrono::hours::zero()) {
584 throw BadInputError("Template refresh interval is outside acceptable range.");
585 }
586 mTemplateRefreshRate = templateRefreshRateHours;
587
588 if (templateBatchSize < kMinTemplateBatchNum || templateBatchSize > kMaxTemplateBatchNum) {
589 throw BadInputError("Template batch size is outside acceptable range.");
590 }
591 mTemplateBatchSize = templateBatchSize;
592 }
593
599 MIP_API void AddRmsCapability(const std::string& capability);
600
606 MIP_API bool RemoveRmsCapability(const std::string& capability);
607
611 std::vector<std::string> GetRmsCapabilities() const { return mCapabilities; }
612
613#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
619 const std::shared_ptr<void>& GetLoggerContext() const { return mLoggerContext; }
620#endif
621
628 void SetLoggerContext(const std::shared_ptr<void>& loggerContext) {
629 mLoggerContext = loggerContext;
630 }
631
633 private:
634 std::string mEngineId;
635 Identity mIdentity;
636 Cloud mCloud = Cloud::Unknown;
637 DataBoundary mDataBoundary = DataBoundary::Default;
638 std::shared_ptr<AuthDelegate> mAuthDelegate;
639 std::string mClientData;
640 std::vector<std::pair<std::string, std::string>> mCustomSettings;
641 std::vector<std::string> mCapabilities;
642 std::string mCloudEndpointBaseUrl;
643 std::string mLocale;
644 std::string mSessionId;
645 std::string mUnderlyingApplicationId;
646 bool mAllowCloudServiceOnly;
647 std::chrono::hours mTemplateRefreshRate;
648 int mTemplateBatchSize;
649 std::shared_ptr<void> mLoggerContext;
651 };
652
658 virtual const Settings& GetSettings() const = 0;
659
669 virtual std::shared_ptr<AsyncControl> GetTemplatesAsync(
670 const std::shared_ptr<ProtectionEngine::Observer>& observer,
671 const std::shared_ptr<void>& context,
672 const std::shared_ptr<const GetTemplatesSettings>& templateSettings) = 0;
673
682 virtual std::shared_ptr<AsyncControl> GetTemplatesAsync(
683 const std::shared_ptr<ProtectionEngine::Observer>& observer,
684 const std::shared_ptr<void>& context) = 0;
685
694 virtual std::vector<std::shared_ptr<TemplateDescriptor>> GetTemplates(
695 const std::shared_ptr<void>& context,
696 const std::shared_ptr<const GetTemplatesSettings>& templateSettings) = 0;
697
705 virtual std::vector<std::shared_ptr<TemplateDescriptor>> GetTemplates(const std::shared_ptr<void>& context) = 0;
706
714 virtual bool IsFeatureSupported(FeatureId featureId) = 0;
715
730 virtual std::shared_ptr<AsyncControl> GetRightsForLabelIdAsync(
731 const std::string& documentId,
732 const std::string& labelId,
733 const std::string& ownerEmail,
734 const std::string& delegatedUserEmail,
735 const std::shared_ptr<ProtectionEngine::Observer>& observer,
736 const std::shared_ptr<void>& context,
737 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
738
751 virtual std::vector<std::string> GetRightsForLabelId(
752 const std::string& documentId,
753 const std::string& labelId,
754 const std::string& ownerEmail,
755 const std::string& delegatedUserEmail,
756 const std::shared_ptr<void>& context,
757 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
758
772 virtual std::shared_ptr<mip::LicenseInfo> GetLicenseInfoForLabelId(
773 const std::string& documentId,
774 const std::string& labelId,
775 const std::string& ownerEmail,
776 const std::string& delegatedUserEmail,
777 const std::shared_ptr<void>& context,
778 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
779
791 virtual std::shared_ptr<AsyncControl> CreateProtectionHandlerForPublishingAsync(
793 const std::shared_ptr<ProtectionHandler::Observer>& observer,
794 const std::shared_ptr<void>& context) = 0;
795
806 virtual std::shared_ptr<ProtectionHandler> CreateProtectionHandlerForPublishing(
808 const std::shared_ptr<void>& context) = 0;
809
819 virtual std::shared_ptr<AsyncControl> CreateProtectionHandlerForConsumptionAsync(
821 const std::shared_ptr<ProtectionHandler::Observer>& observer,
822 const std::shared_ptr<void>& context) = 0;
823
832 virtual std::shared_ptr<ProtectionHandler> CreateProtectionHandlerForConsumption(
834 const std::shared_ptr<void>& context) = 0;
835
844#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
845 [[deprecated("ProtectionEngine::LoadUserCert is deprecated, use ProtectionEngine::LoadUserCertSync")]]
846#endif
847 virtual bool LoadUserCert(
848 const std::shared_ptr<void>& context,
850 try {
851 LoadUserCertSync(context, settings);
852 } catch (...) {
853 return false;
854 }
855 return true;
856 }
857
865 virtual void LoadUserCertSync(
866 const std::shared_ptr<void>& context,
867 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
868
878 virtual std::shared_ptr<AsyncControl> LoadUserCertAsync(
879 const std::shared_ptr<ProtectionEngine::Observer>& observer,
880 const std::shared_ptr<void>& context,
881 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
882
891 const std::vector<uint8_t>& serializedPublishingLicense,
892 const std::string& contentName,
893 bool isOwnerNotificationEnabled,
894 const std::shared_ptr<void>& context,
895 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
896
908 virtual std::shared_ptr<AsyncControl> RegisterContentForTrackingAndRevocationAsync(
909 const std::vector<uint8_t>& serializedPublishingLicense,
910 const std::string& contentName,
911 bool isOwnerNotificationEnabled,
912 const std::shared_ptr<ProtectionEngine::Observer>& observer,
913 const std::shared_ptr<void>& context,
914 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
915
922 virtual void RevokeContent(
923 const std::vector<uint8_t>& serializedPublishingLicense,
924 const std::shared_ptr<void>& context,
925 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
926
936 virtual std::shared_ptr<AsyncControl> RevokeContentAsync(
937 const std::vector<uint8_t>& serializedPublishingLicense,
938 const std::shared_ptr<ProtectionEngine::Observer>& observer,
939 const std::shared_ptr<void>& context,
940 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
941
952 virtual std::vector<std::shared_ptr<DelegationLicense>> CreateDelegationLicenses(
953 const DelegationLicenseSettings& settings,
954 const std::shared_ptr<void>& context) = 0;
955
969 virtual std::shared_ptr<AsyncControl> CreateDelegationLicensesAsync(
970 const DelegationLicenseSettings& settings,
971 const std::shared_ptr<ProtectionEngine::Observer>& observer,
972 const std::shared_ptr<void>& context) = 0;
973
982 virtual std::shared_ptr<TenantInformation> GetTenantInformation(
983 const ProtectionCommonSettings& settings,
984 const std::shared_ptr<void>& context) = 0;
985
998 virtual std::shared_ptr<AsyncControl> GetTenantInformationAsync(
999 const ProtectionCommonSettings& settings,
1000 const std::shared_ptr<ProtectionEngine::Observer>& observer,
1001 const std::shared_ptr<void>& context) = 0;
1002
1014 virtual std::shared_ptr<LicenseRightsData> GetLicenseRightsData(
1015 const std::vector<uint8_t>& serializedPublishingLicense,
1016 const std::shared_ptr<void>& context,
1017 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
1018
1031 virtual std::shared_ptr<AsyncControl> GetLicenseRightsDataAsync(
1032 const std::vector<uint8_t>& serializedPublishingLicense,
1033 const std::shared_ptr<ProtectionEngine::Observer>& observer,
1034 const std::shared_ptr<void>& context,
1035 const ProtectionCommonSettings& settings = ProtectionCommonSettings()) = 0;
1036
1042 virtual void DeleteStoredData(bool deleteAllData = false) = 0;
1043
1049 virtual void DeleteStoredData(std::chrono::time_point<std::chrono::system_clock> timePoint) = 0;
1050
1052 virtual ~ProtectionEngine() {}
1053protected:
1054 ProtectionEngine() {}
1056};
1057
1058MIP_NAMESPACE_END
1059
1060#endif // API_MIP_PROTECTION_PROTECTION_ENGINE_H_
Bad input error, thrown when the input to an SDK API is invalid.
Definition error.h:249
Definition delegation_license_settings.h:47
Abstraction for identity.
Definition common_types.h:278
Settings to use for protection operations.
Definition protection_common_settings.h:46
Interface that receives notifications related to ProtectionEngine.
Definition protection_engine.h:81
virtual void OnRevokeContentSuccess(const std::shared_ptr< void > &context)
Called when revocation of is successful.
Definition protection_engine.h:200
virtual void OnCreateDelegatedLicensesFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when create delegated license fails.
Definition protection_engine.h:240
virtual void OnGetTenantInformationAsyncFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when GetTenantInformationAsync fails.
Definition protection_engine.h:267
virtual void OnGetTenantInformationAsyncSuccess(const std::shared_ptr< TenantInformation > &tenantInformation, const std::shared_ptr< void > &context)
Called when GetTenantInformationAsync is successful.
Definition protection_engine.h:253
virtual void OnGetTemplatesFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when retrieving templates generated an error.
Definition protection_engine.h:107
virtual void OnLoadUserCertSuccess(const std::shared_ptr< void > &context)
Called when user cert loaded successfully.
Definition protection_engine.h:148
virtual void OnRegisterContentForTrackingAndRevocationSuccess(const std::shared_ptr< void > &context)
Called when registration of content for tracking & revocation is successful.
Definition protection_engine.h:174
virtual void OnGetLicenseRightsDataSuccess(const std::shared_ptr< LicenseRightsData > &licenseRightsData, const std::shared_ptr< void > &context)
Called when license rights data were retrieved successfully.
Definition protection_engine.h:281
virtual void OnGetTemplatesSuccess(const std::vector< std::shared_ptr< TemplateDescriptor > > &templateDescriptors, const std::shared_ptr< void > &context)
Called when templates were retrieved successfully.
Definition protection_engine.h:93
virtual void OnRevokeContentFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when revocation of content is fails.
Definition protection_engine.h:213
virtual void OnCreateDelegatedLicensesSuccess(std::vector< std::shared_ptr< DelegationLicense > > delegatedLicenses, const std::shared_ptr< void > &context)
Called when create delegated license is successful.
Definition protection_engine.h:226
virtual void OnGetLicenseRightsDataFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when retrieving license rights data fails.
Definition protection_engine.h:295
virtual void OnGetRightsForLabelIdSuccess(const std::shared_ptr< std::vector< std::string > > &rights, const std::shared_ptr< void > &context)
Called when rights were retrieved successfully.
Definition protection_engine.h:121
virtual void OnRegisterContentForTrackingAndRevocationFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when registration of content for tracking & revocation fails.
Definition protection_engine.h:187
virtual void OnLoadUserCertFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when user cert loaded failed.
Definition protection_engine.h:161
virtual void OnGetRightsForLabelIdFailure(const std::exception_ptr &error, const std::shared_ptr< void > &context)
Called when retrieving rights for a label ID for the user.
Definition protection_engine.h:135
Settings used by ProtectionEngine during its creation and throughout its lifetime.
Definition protection_engine.h:309
const std::string & GetSessionId() const
Gets the engine session ID.
Definition protection_engine.h:444
MIP_API void AddRmsCapability(const std::string &capability)
Add a capability which will be passed along to RMS when fetching usage rights.
const std::string & GetCloudEndpointBaseUrl() const
Gets the cloud base URL used by all service requests, if specified.
Definition protection_engine.h:505
void SetCustomSettings(const std::vector< std::pair< std::string, std::string > > &value)
Sets name/value pairs used for testing and experimentation.
Definition protection_engine.h:421
std::chrono::hours GetTemplateRefreshInterval() const
Gets the refresh rate of the protection templates.
Definition protection_engine.h:560
void SetDataBoundary(DataBoundary dataBoundary)
Optionally sets the target diagnostic region.
Definition protection_engine.h:476
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings() const
Gets name/value pairs used for testing and experimentation.
Definition protection_engine.h:428
void SetIdentity(const Identity &identity)
Sets the user Identity associated with the engine.
Definition protection_engine.h:393
DataBoundary GetDataBoundary() const
Gets the data boundary region.
Definition protection_engine.h:485
void SetClientData(const std::string &clientData)
Sets custom data specified by client.
Definition protection_engine.h:407
bool GetAllowCloudServiceOnly() const
Gets whether or not only cloud service is allowed.
Definition protection_engine.h:544
Settings(const std::string &engineId, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="")
ProtectionEngine::Settings constructor for loading an existing engine.
Definition protection_engine.h:350
const std::string & GetClientData() const
Gets custom data specified by client.
Definition protection_engine.h:400
Cloud GetCloud() const
Gets the target cloud used by all service requests.
Definition protection_engine.h:465
Settings(const Identity &identity, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="")
ProtectionEngine::Settings constructor for creating a new engine.
Definition protection_engine.h:322
MIP_API bool RemoveRmsCapability(const std::string &capability)
Remove one of the added usage rights capabilities which get passed to RMS.
const Identity & GetIdentity() const
Gets the user Identity associated with the engine.
Definition protection_engine.h:386
void SetCloud(Cloud cloud)
Optionally sets the target cloud.
Definition protection_engine.h:456
void SetTemplateRefreshArgs(std::chrono::hours templateRefreshRateHours, int templateBatchSize=kMaxTemplateBatchNum)
Sets a custom refresh rate for templates.
Definition protection_engine.h:582
void SetEngineId(const std::string &engineId)
Sets the engine ID.
Definition protection_engine.h:379
int GetTemplateBatchSize() const
Gets the number of templates to be requested in each batch during GetTemplates.
Definition protection_engine.h:567
void SetSessionId(const std::string &sessionId)
Sets the engine session ID, used for correlation of logging/telemetry.
Definition protection_engine.h:435
void SetAuthDelegate(const std::shared_ptr< AuthDelegate > &authDelegate)
Set the Engine Auth Delegate.
Definition protection_engine.h:514
const std::string & GetUnderlyingApplicationId() const
Gets the Underlying Application ID.
Definition protection_engine.h:530
void SetAllowCloudServiceOnly(bool allowCloudServiceOnly)
Sets whether or not only cloud service is allowed.
Definition protection_engine.h:551
const std::shared_ptr< void > & GetLoggerContext() const
Get logger context that will be opaquely passed to the logger delegate for logs associated with the c...
Definition protection_engine.h:619
void SetLoggerContext(const std::shared_ptr< void > &loggerContext)
Sets the logger context that will be opaquely passed to the logger delegate for logs associated with ...
Definition protection_engine.h:628
const std::string & GetEngineId() const
Gets the engine ID.
Definition protection_engine.h:372
void SetUnderlyingApplicationId(const std::string &underlyingApplicationId)
Sets the Underlying Application ID.
Definition protection_engine.h:537
std::shared_ptr< AuthDelegate > GetAuthDelegate() const
Get the Engine Auth Delegate.
Definition protection_engine.h:523
std::vector< std::string > GetRmsCapabilities() const
The the full set of client capabilities supported when fetching usage rights from RMS.
Definition protection_engine.h:611
const std::string & GetLocale() const
Gets the locale in which engine data will be written.
Definition protection_engine.h:414
void SetCloudEndpointBaseUrl(const std::string &cloudEndpointBaseUrl)
Sets the cloud endpoint base URL for custom cloud.
Definition protection_engine.h:496
Manages protection-related actions related to a specific identity.
Definition protection_engine.h:74
virtual void DeleteStoredData(bool deleteAllData=false)=0
Removes stored data from the license store.
virtual std::shared_ptr< AsyncControl > LoadUserCertAsync(const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
pre-emptively load user licensor certificate, useful when background loading else using prelicense mi...
virtual std::shared_ptr< AsyncControl > GetLicenseRightsDataAsync(const std::vector< uint8_t > &serializedPublishingLicense, const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Get the rights data for a license. This method requires the requesting identity to be included in the...
virtual std::shared_ptr< mip::LicenseInfo > GetLicenseInfoForLabelId(const std::string &documentId, const std::string &labelId, const std::string &ownerEmail, const std::string &delegatedUserEmail, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Get the collection of properties (including usage rights) associated with a user for a given label ID...
virtual void RevokeContent(const std::vector< uint8_t > &serializedPublishingLicense, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Perform revocation for content.
virtual std::vector< std::string > GetRightsForLabelId(const std::string &documentId, const std::string &labelId, const std::string &ownerEmail, const std::string &delegatedUserEmail, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Get collection of rights available to a user for a labelId.
virtual std::shared_ptr< AsyncControl > RevokeContentAsync(const std::vector< uint8_t > &serializedPublishingLicense, const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Perform revocation for content.
virtual std::shared_ptr< AsyncControl > GetTemplatesAsync(const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context, const std::shared_ptr< const GetTemplatesSettings > &templateSettings)=0
Get collection of templates available to a user.
virtual std::shared_ptr< AsyncControl > CreateDelegationLicensesAsync(const DelegationLicenseSettings &settings, const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context)=0
Creates a delegated license.
virtual std::shared_ptr< AsyncControl > CreateProtectionHandlerForConsumptionAsync(const ProtectionHandler::ConsumptionSettings &settings, const std::shared_ptr< ProtectionHandler::Observer > &observer, const std::shared_ptr< void > &context)=0
Creates a protection handler where rights/roles are assigned to specific users.
virtual std::vector< std::shared_ptr< TemplateDescriptor > > GetTemplates(const std::shared_ptr< void > &context)=0
Get collection of templates available to a user.
virtual void RegisterContentForTrackingAndRevocation(const std::vector< uint8_t > &serializedPublishingLicense, const std::string &contentName, bool isOwnerNotificationEnabled, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Register publishing license (PL) for document tracking & revocation.
virtual std::vector< std::shared_ptr< TemplateDescriptor > > GetTemplates(const std::shared_ptr< void > &context, const std::shared_ptr< const GetTemplatesSettings > &templateSettings)=0
Get collection of templates available to a user.
virtual void DeleteStoredData(std::chrono::time_point< std::chrono::system_clock > timePoint)=0
Removes stored data from the license store past a specific time point.
virtual std::shared_ptr< ProtectionHandler > CreateProtectionHandlerForPublishing(const ProtectionHandler::PublishingSettings &settings, const std::shared_ptr< void > &context)=0
Creates a protection handler where rights/roles are assigned to specific users.
virtual bool LoadUserCert(const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())
pre-emptively load user licensor certificate, useful when background loading else using prelicense mi...
Definition protection_engine.h:847
virtual std::shared_ptr< AsyncControl > CreateProtectionHandlerForPublishingAsync(const ProtectionHandler::PublishingSettings &settings, const std::shared_ptr< ProtectionHandler::Observer > &observer, const std::shared_ptr< void > &context)=0
Creates a protection handler where rights/roles are assigned to specific users.
virtual std::vector< std::shared_ptr< DelegationLicense > > CreateDelegationLicenses(const DelegationLicenseSettings &settings, const std::shared_ptr< void > &context)=0
Creates a delegated license.
virtual std::shared_ptr< ProtectionHandler > CreateProtectionHandlerForConsumption(const ProtectionHandler::ConsumptionSettings &settings, const std::shared_ptr< void > &context)=0
Creates a protection handler where rights/roles are assigned to specific users.
virtual std::shared_ptr< AsyncControl > GetRightsForLabelIdAsync(const std::string &documentId, const std::string &labelId, const std::string &ownerEmail, const std::string &delegatedUserEmail, const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Get collection of rights available to a user for a label ID.
virtual bool IsFeatureSupported(FeatureId featureId)=0
Check is feature supported.
virtual std::shared_ptr< TenantInformation > GetTenantInformation(const ProtectionCommonSettings &settings, const std::shared_ptr< void > &context)=0
Loads user licensor certificate and returns information about the tenant.
virtual std::shared_ptr< AsyncControl > GetTenantInformationAsync(const ProtectionCommonSettings &settings, const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context)=0
Loads user licensor certificate and returns information about the tenant.
virtual void LoadUserCertSync(const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
pre-emptively load user licensor certificate, useful when background loading else using prelicense mi...
virtual std::shared_ptr< AsyncControl > RegisterContentForTrackingAndRevocationAsync(const std::vector< uint8_t > &serializedPublishingLicense, const std::string &contentName, bool isOwnerNotificationEnabled, const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Register publishing license (PL) for document tracking & revocation.
virtual std::shared_ptr< LicenseRightsData > GetLicenseRightsData(const std::vector< uint8_t > &serializedPublishingLicense, const std::shared_ptr< void > &context, const ProtectionCommonSettings &settings=ProtectionCommonSettings())=0
Get the rights data for a license. This method requires the requesting identity to be included in the...
virtual const Settings & GetSettings() const =0
Gets the engine settings.
virtual std::shared_ptr< AsyncControl > GetTemplatesAsync(const std::shared_ptr< ProtectionEngine::Observer > &observer, const std::shared_ptr< void > &context)=0
Get collection of templates available to a user.
Settings used to create a ProtectionHandler to consume existing content.
Definition protection_handler.h:111
Settings used to create a ProtectionHandler to protect new content.
Definition protection_handler.h:228
A file Containing the common types used by the upe, file and protection modules.
FeatureId
Defines new features by name.
Definition common_types.h:151
Cloud
Azure cloud identifier.
Definition common_types.h:752
DataBoundary
Diagnostic region identifier for non-sovereign clouds.
Definition common_types.h:769
Defines DelegationLicense interface.
Defines DelegationLicenseSettings class.
A file containing the MIP SDK error types.
Defines GetTemplatesSettings interface.
Defines LicenseInfo interface.
Defines LicenseRightstData interface.
A file export/import macros.
MIP namespace macros.
Definition rights.h:43
A file containing the common types used by the protection module.
Defines ProtectionDescriptor interface.
Defines ProtectionHandler interface.
Defines TemplateDescriptor interface.
Defines TenantInformation interface.