Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
ProtectionHandler::ConsumptionSettings Class Reference

Settings used to create a ProtectionHandler to consume existing content. More...

#include <src/api/mip/protection/protection_handler.h>

+ Inheritance diagram for ProtectionHandler::ConsumptionSettings:
+ Collaboration diagram for ProtectionHandler::ConsumptionSettings:

Public Member Functions

MIP_API void AddRmsCapability (const std::string &capability)
 Add a capability which will be passed along to RMS when fetching usage rights.
 
 ConsumptionSettings (const std::shared_ptr< PublishingLicenseInfo > &licenseInfo)
 ProtectionHandler::ConsumptionSettings constructor for creating a new handler.
 
 ConsumptionSettings (const std::vector< uint8_t > &serializedPreLicense, const std::vector< uint8_t > &serializedPublishingLicense)
 ProtectionHandler::ConsumptionSettings constructor for creating a new handler.
 
 ConsumptionSettings (const std::vector< uint8_t > &serializedPublishingLicense)
 ProtectionHandler::ConsumptionSettings constructor for creating a new handler.
 
std::string GetApplicationScenarioId () const
 Gets the scenario Id provided by the application which is used to correlation with the server.
 
const std::string & GetContentName () const
 Gets the content name to register with document tracking.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Get the custom settings, used for feature gating and testing.
 
const std::string & GetDelegatedUserEmail () const
 Gets the delegated user.
 
bool GetIsOfflineOnly () const
 Gets whether or not ProtectionEngine operation allows for online HTTP operations.
 
std::shared_ptr< PublishingLicenseInfoGetPublishingLicenseInfo () const
 Get the publishing license associated with the protected content.
 
const std::shared_ptr< std::vector< std::string > > GetRmsCapabilities () const
 The the full set of client capabilities supported when fetching usage rights from RMS.
 
MIP_API bool RemoveRmsCapability (const std::string &capability)
 Remove one of the added usage rights capabilities which get passed to RMS.
 
void SetApplicationScenarioId (std::string applicationScenarioId)
 Sets the scenario Id provided by the application.
 
void SetContentName (const std::string &contentName)
 Defines the content name to register with document tracking.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &customSettings)
 Set the custom settings, used for feature gating and testing.
 
void SetDelegatedUserEmail (const std::string &delegatedUserEmail)
 Sets the delegated user.
 
virtual void SetIsOfflineOnly (bool isOfflineOnly)
 Sets whether or not ProtectionEngine operation allows for online HTTP operations.
 

Detailed Description

Settings used to create a ProtectionHandler to consume existing content.

Definition at line 111 of file protection_handler.h.

Constructor & Destructor Documentation

◆ ConsumptionSettings() [1/3]

ProtectionHandler::ConsumptionSettings::ConsumptionSettings ( const std::vector< uint8_t > & serializedPublishingLicense)
inline

ProtectionHandler::ConsumptionSettings constructor for creating a new handler.

Parameters
serializedPublishingLicenseSerialized publishing license from protected content

Definition at line 118 of file protection_handler.h.

119 : mLicenseInfo(std::make_shared<PublishingLicenseInfo>(serializedPublishingLicense)) {}

◆ ConsumptionSettings() [2/3]

ProtectionHandler::ConsumptionSettings::ConsumptionSettings ( const std::vector< uint8_t > & serializedPreLicense,
const std::vector< uint8_t > & serializedPublishingLicense )
inline

ProtectionHandler::ConsumptionSettings constructor for creating a new handler.

Parameters
serializedPreLicenseSerialized pre license from attached to the content.
serializedPublishingLicenseSerialized publishing license from protected content

Definition at line 127 of file protection_handler.h.

130 : mLicenseInfo(std::make_shared<PublishingLicenseInfo>(serializedPreLicense, serializedPublishingLicense)) {}

◆ ConsumptionSettings() [3/3]

ProtectionHandler::ConsumptionSettings::ConsumptionSettings ( const std::shared_ptr< PublishingLicenseInfo > & licenseInfo)
inline

ProtectionHandler::ConsumptionSettings constructor for creating a new handler.

Parameters
licenseInfoPublishing license info from protected content
Note
Providing a PublishingLicenseInfo (as opposed to just a raw serialized publishing license) will remove the need for MIP SDK to parse the publishing license.

Definition at line 140 of file protection_handler.h.

141 : mLicenseInfo(licenseInfo) {}

Member Function Documentation

◆ AddRmsCapability()

MIP_API void ProtectionHandler::ConsumptionSettings::AddRmsCapability ( const std::string & capability)

Add a capability which will be passed along to RMS when fetching usage rights.

Remarks
Capabilities configured for this protection handler take precedence over any RMS capabilities configured on the protection engine.
Parameters
capabilityAn identifier that describes a capability that RMS supports

◆ GetApplicationScenarioId()

std::string ProtectionCommonSettings::GetApplicationScenarioId ( ) const
inlineinherited

Gets the scenario Id provided by the application which is used to correlation with the server.

Returns
Application scenario Id

Definition at line 57 of file protection_common_settings.h.

57 {
58 return mApplicationScenarioId;
59 }

◆ GetContentName()

const std::string & ProtectionHandler::ConsumptionSettings::GetContentName ( ) const
inline

Gets the content name to register with document tracking.

Returns
The content name

Definition at line 184 of file protection_handler.h.

184{ return mContentName; }

◆ GetCustomSettings()

const std::vector< std::pair< std::string, std::string > > & ProtectionCommonSettings::GetCustomSettings ( ) const
inlineinherited

Get the custom settings, used for feature gating and testing.

Returns
List of name/value pairs.

Definition at line 108 of file protection_common_settings.h.

108 {
109 return mCustomSettings;
110 }

◆ GetDelegatedUserEmail()

const std::string & ProtectionHandler::ConsumptionSettings::GetDelegatedUserEmail ( ) const
inline

Gets the delegated user.

Returns
Delegated user
Note
A delegated user is specified when the authenticating user/application is acting on behalf of another user

Definition at line 168 of file protection_handler.h.

168{ return mDelegatedUserEmail; }

◆ GetIsOfflineOnly()

bool ProtectionCommonSettings::GetIsOfflineOnly ( ) const
inlineinherited

Gets whether or not ProtectionEngine operation allows for online HTTP operations.

Returns
True if HTTP operations are disallowed, else false
Note
If this returns true, operation will only succeed if necessary content has already been cached. A mip::NetworkError will be thrown if needed info is not found. Consumption - content has already been previously decrypted and its unexpired license is cached. Protection - unexpired templates have been cached and user cert is loaded Others - undefined

Definition at line 79 of file protection_common_settings.h.

79{ return mIsOfflineOnly; }

◆ GetPublishingLicenseInfo()

std::shared_ptr< PublishingLicenseInfo > ProtectionHandler::ConsumptionSettings::GetPublishingLicenseInfo ( ) const
inline

Get the publishing license associated with the protected content.

Returns
Publishing license information

Definition at line 148 of file protection_handler.h.

148 {
149 return mLicenseInfo;
150 }

◆ GetRmsCapabilities()

const std::shared_ptr< std::vector< std::string > > ProtectionHandler::ConsumptionSettings::GetRmsCapabilities ( ) const
inline

The the full set of client capabilities supported when fetching usage rights from RMS.

Returns
a pointer to a list of capabilities.

Definition at line 211 of file protection_handler.h.

211 {
212 if (mCapabilities == nullptr) { return mCapabilities; }
213 return std::make_shared<std::vector<std::string>>(*mCapabilities);
214 }

◆ RemoveRmsCapability()

MIP_API bool ProtectionHandler::ConsumptionSettings::RemoveRmsCapability ( const std::string & capability)

Remove one of the added usage rights capabilities which get passed to RMS.

Remarks
Capabilities configured for this protection handler take precedence over any RMS capabilities configured on the protection engine.
Parameters
capabilityThe capability which should be removed.

◆ SetApplicationScenarioId()

void ProtectionCommonSettings::SetApplicationScenarioId ( std::string applicationScenarioId)
inlineinherited

Sets the scenario Id provided by the application.

Parameters
Theapplication scenario Id

Definition at line 66 of file protection_common_settings.h.

66{ mApplicationScenarioId = applicationScenarioId; }

◆ SetContentName()

void ProtectionHandler::ConsumptionSettings::SetContentName ( const std::string & contentName)
inline

Defines the content name to register with document tracking.

Parameters
contentNameThe identifier to register content under.
Note
: If the content has already been registered, its name will not be changed.

Definition at line 177 of file protection_handler.h.

177{ mContentName = contentName;}

◆ SetCustomSettings()

void ProtectionCommonSettings::SetCustomSettings ( const std::vector< std::pair< std::string, std::string > > & customSettings)
inlineinherited

Set the custom settings, used for feature gating and testing.

Parameters
customSettingsList of name/value pairs.

Definition at line 99 of file protection_common_settings.h.

99 {
100 mCustomSettings = customSettings;
101 }

◆ SetDelegatedUserEmail()

void ProtectionHandler::ConsumptionSettings::SetDelegatedUserEmail ( const std::string & delegatedUserEmail)
inline

Sets the delegated user.

Parameters
delegatedUserEmailthe delegation email.
Note
A delegated user is specified when the authenticating user/application is acting on behalf of another user

Definition at line 159 of file protection_handler.h.

159{ mDelegatedUserEmail = delegatedUserEmail; }

◆ SetIsOfflineOnly()

virtual void ProtectionCommonSettings::SetIsOfflineOnly ( bool isOfflineOnly)
inlinevirtualinherited

Sets whether or not ProtectionEngine operation allows for online HTTP operations.

Parameters
isOfflineOnlyTrue if HTTP operations are disallowed, else false
Note
If this is set to true, operation will only succeed if necessary content has already been cached. A mip::NetworkError will be thrown if needed info is not found. Consumption - content has already been previously decrypted and its unexpired license is cached. Protection - unexpired templates have been cached and user cert is loaded Others - undefined

Definition at line 92 of file protection_common_settings.h.

92{ mIsOfflineOnly = isOfflineOnly; }

The documentation for this class was generated from the following file: