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

Settings used to create a ProtectionHandler to protect new content. More...

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

+ Inheritance diagram for ProtectionHandler::PublishingSettings:
+ Collaboration diagram for ProtectionHandler::PublishingSettings:

Public Member Functions

std::string GetApplicationScenarioId () const
 Gets the scenario Id provided by the application which is used to correlation with the server.
 
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 GetIsAuditedExtractionAllowed () const
 Gets whether or not non-MIP-aware applications are allowed to open protected content.
 
bool GetIsDeprecatedAlgorithmPreferred () const
 Gets whether or not deprecated crypto algorithm (ECB) is preferred for backwards compatibility.
 
bool GetIsOfflineOnly () const
 Gets whether or not ProtectionEngine operation allows for online HTTP operations.
 
std::shared_ptr< PublishingUseLicenseRequestGetPreLicenseRequest () const
 Gets the pre-license request.
 
const std::string & GetPreLicenseUserEmail () const
 Gets the pre-license user.
 
std::shared_ptr< ProtectionDescriptorGetProtectionDescriptor () const
 
std::shared_ptr< ProtectionHandlerGetProtectionHandlerForRepublish () const
 Gets protection handler for republishing scenario.
 
const std::vector< uint8_t > & GetPublishingLicenseForRepublish () const
 Gets the serialized republishing license.
 
bool GetRegenerateContentKey () const
 Gets whether or not the content key and ID should be regenerated during republishing.
 
bool GetRepairLabelIdAllowed () const
 Gets whether or not label id can be added to publishing license on republish.
 
bool IsPublishingFormatJson () const
 Gets whether or not the returned pl is in json format (xml format is more widely accepted and is the default).
 
 PublishingSettings (const std::shared_ptr< ProtectionDescriptor > &protectionDescriptor)
 PublishingSettings constructor for enforcing protection on content.
 
 PublishingSettings (const std::shared_ptr< ProtectionDescriptor > &protectionDescriptor, const std::shared_ptr< ProtectionHandler > &protectionHandler)
 PublishingSettings constructor for offline republishing.
 
 PublishingSettings (const std::shared_ptr< ProtectionDescriptor > &protectionDescriptor, const std::vector< uint8_t > &serializedPublishingLicense)
 PublishingSettings constructor for online republishing.
 
void SetApplicationScenarioId (std::string applicationScenarioId)
 Sets the scenario Id provided by the application.
 
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.
 
void SetIsAuditedExtractionAllowed (bool isAuditedExtractionAllowed)
 Sets whether or not non-MIP-aware applications are allowed to open protected content.
 
void SetIsDeprecatedAlgorithmPreferred (bool isDeprecatedAlgorithmPreferred)
 Sets whether or not deprecated crypto algorithm (ECB) is preferred for backwards compatibility.
 
virtual void SetIsOfflineOnly (bool isOfflineOnly)
 Sets whether or not ProtectionEngine operation allows for online HTTP operations.
 
void SetPreLicenseUserEmail (const std::string &preLicenseUserEmail)
 Sets pre-license user.
 
void SetPublishingFormatJson (bool isPublishingFormatJson)
 Sets whether or not the returned pl is in json format (xml format is more widely accepted and is the default).
 
void SetRegenerateContentKey (bool regenerateContentKey)
 Sets whether or not the content key and ID should be regenerated during republishing.
 
void SetRepairLabelIdAllowed (bool repairAllowed)
 Sets whether or not label id can be added to publishing license on republish.
 
void SetRequestPreLicense (std::shared_ptr< PublishingUseLicenseRequest > publishingUseLicenseRequest)
 Setting this will cause the publishing request to include a pre-license.
 

Detailed Description

Settings used to create a ProtectionHandler to protect new content.

Definition at line 228 of file protection_handler.h.

Constructor & Destructor Documentation

◆ PublishingSettings() [1/3]

ProtectionHandler::PublishingSettings::PublishingSettings ( const std::shared_ptr< ProtectionDescriptor > & protectionDescriptor)
inline

PublishingSettings constructor for enforcing protection on content.

Parameters
protectionDescriptorProtection details

Definition at line 235 of file protection_handler.h.

236 : mProtectionDescriptor(protectionDescriptor),
237 mIsAuditedExtractionAllowed(false),
238 mIsDeprecatedAlgorithmPreferred(false),
239 mIsPublishingFormatJson(false),
240 mRepairLabelIdAllowed(false),
241 mRegenerateContentKey(false) {}

◆ PublishingSettings() [2/3]

ProtectionHandler::PublishingSettings::PublishingSettings ( const std::shared_ptr< ProtectionDescriptor > & protectionDescriptor,
const std::vector< uint8_t > & serializedPublishingLicense )
inline

PublishingSettings constructor for online republishing.

Parameters
protectionDescriptorNew protection details
serializedPublishingLicenseOriginal protection license

Definition at line 249 of file protection_handler.h.

252 : mProtectionDescriptor(protectionDescriptor),
253 mRepublishingLicense(serializedPublishingLicense),
254 mIsAuditedExtractionAllowed(false),
255 mIsDeprecatedAlgorithmPreferred(false),
256 mIsPublishingFormatJson(false),
257 mRepairLabelIdAllowed(false),
258 mRegenerateContentKey(false) {}

◆ PublishingSettings() [3/3]

ProtectionHandler::PublishingSettings::PublishingSettings ( const std::shared_ptr< ProtectionDescriptor > & protectionDescriptor,
const std::shared_ptr< ProtectionHandler > & protectionHandler )
inline

PublishingSettings constructor for offline republishing.

Parameters
protectionDescriptorNew protection details
protectionHandlerOriginal protection handler

Definition at line 266 of file protection_handler.h.

269 : mProtectionDescriptor(protectionDescriptor),
270 mProtectionHandler(protectionHandler),
271 mIsAuditedExtractionAllowed(false),
272 mIsDeprecatedAlgorithmPreferred(false),
273 mIsPublishingFormatJson(false),
274 mRepairLabelIdAllowed(false),
275 mRegenerateContentKey(false) {}

Member Function Documentation

◆ 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 }

◆ 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::PublishingSettings::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 332 of file protection_handler.h.

332{ return mDelegatedUserEmail; }

◆ GetIsAuditedExtractionAllowed()

bool ProtectionHandler::PublishingSettings::GetIsAuditedExtractionAllowed ( ) const
inline

Gets whether or not non-MIP-aware applications are allowed to open protected content.

Returns
If non-MIP-aware applications are allowed to open protected content

Definition at line 289 of file protection_handler.h.

289{ return mIsAuditedExtractionAllowed; }

◆ GetIsDeprecatedAlgorithmPreferred()

bool ProtectionHandler::PublishingSettings::GetIsDeprecatedAlgorithmPreferred ( ) const
inline

Gets whether or not deprecated crypto algorithm (ECB) is preferred for backwards compatibility.

Returns
If deprecated crypto algorithm is preferred

Definition at line 305 of file protection_handler.h.

305{ return mIsDeprecatedAlgorithmPreferred; }

◆ 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; }

◆ GetPreLicenseRequest()

std::shared_ptr< PublishingUseLicenseRequest > ProtectionHandler::PublishingSettings::GetPreLicenseRequest ( ) const
inline

Gets the pre-license request.

Returns
Pre-license request

Definition at line 421 of file protection_handler.h.

421 {
422 return mPublishingUseLicenseRequest;
423 }

◆ GetPreLicenseUserEmail()

const std::string & ProtectionHandler::PublishingSettings::GetPreLicenseUserEmail ( ) const
inline

Gets the pre-license user.

Returns
Pre-license user

Definition at line 392 of file protection_handler.h.

392 {
393 static std::string empty;
394 return mPublishingUseLicenseRequest != nullptr ? mPublishingUseLicenseRequest->GetDelegatedUserEmail() : empty; }

◆ GetProtectionDescriptor()

std::shared_ptr< ProtectionDescriptor > ProtectionHandler::PublishingSettings::GetProtectionDescriptor ( ) const
inline

Definition at line 277 of file protection_handler.h.

277{ return mProtectionDescriptor; }

◆ GetProtectionHandlerForRepublish()

std::shared_ptr< ProtectionHandler > ProtectionHandler::PublishingSettings::GetProtectionHandlerForRepublish ( ) const
inline

Gets protection handler for republishing scenario.

Definition at line 282 of file protection_handler.h.

282{ return mProtectionHandler; }

◆ GetPublishingLicenseForRepublish()

const std::vector< uint8_t > & ProtectionHandler::PublishingSettings::GetPublishingLicenseForRepublish ( ) const
inline

Gets the serialized republishing license.

Returns
The serialized republishing license

Definition at line 401 of file protection_handler.h.

401 {
402 return mRepublishingLicense;
403 }

◆ GetRegenerateContentKey()

bool ProtectionHandler::PublishingSettings::GetRegenerateContentKey ( ) const
inline

Gets whether or not the content key and ID should be regenerated during republishing.

Returns
True if the content key and ID should be regenerated. False otherwise.

Definition at line 356 of file protection_handler.h.

356{ return mRegenerateContentKey; }

◆ GetRepairLabelIdAllowed()

bool ProtectionHandler::PublishingSettings::GetRepairLabelIdAllowed ( ) const
inline

Gets whether or not label id can be added to publishing license on republish.

Returns
True if label info data in protection descriptor can be added to publishing license
Note
This will only take effect if offline protection is used for republishing.

Definition at line 432 of file protection_handler.h.

432{ return mRepairLabelIdAllowed; }

◆ IsPublishingFormatJson()

bool ProtectionHandler::PublishingSettings::IsPublishingFormatJson ( ) const
inline

Gets whether or not the returned pl is in json format (xml format is more widely accepted and is the default).

Returns
true if is set to json format output.

Definition at line 340 of file protection_handler.h.

340{ return mIsPublishingFormatJson; }

◆ 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; }

◆ 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::PublishingSettings::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 323 of file protection_handler.h.

323{ mDelegatedUserEmail = delegatedUserEmail; }

◆ SetIsAuditedExtractionAllowed()

void ProtectionHandler::PublishingSettings::SetIsAuditedExtractionAllowed ( bool isAuditedExtractionAllowed)
inline

Sets whether or not non-MIP-aware applications are allowed to open protected content.

Parameters
isAuditedExtractionAllowedIf non-MIP-aware applications are allowed to open protected content

Definition at line 296 of file protection_handler.h.

296 {
297 mIsAuditedExtractionAllowed = isAuditedExtractionAllowed;
298 }

◆ SetIsDeprecatedAlgorithmPreferred()

void ProtectionHandler::PublishingSettings::SetIsDeprecatedAlgorithmPreferred ( bool isDeprecatedAlgorithmPreferred)
inline

Sets whether or not deprecated crypto algorithm (ECB) is preferred for backwards compatibility.

Parameters
isDeprecatedAlgorithmPreferredif deprectated crypto algorithm is preferred

Definition at line 312 of file protection_handler.h.

312 {
313 mIsDeprecatedAlgorithmPreferred = isDeprecatedAlgorithmPreferred;
314 }

◆ 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; }

◆ SetPreLicenseUserEmail()

void ProtectionHandler::PublishingSettings::SetPreLicenseUserEmail ( const std::string & preLicenseUserEmail)
inline

Sets pre-license user.

Parameters
preLicenseUserEmailPre-license user
Note
If no pre-license user is specified, a pre-license will not be obtained

Definition at line 377 of file protection_handler.h.

377 {
378 if(mPublishingUseLicenseRequest == nullptr) {
380 }
381 mPublishingUseLicenseRequest->SetDelegatedUserEmail(preLicenseUserEmail);
382 }
static MIP_API std::shared_ptr< PublishingUseLicenseRequest > __CDECL CreatePublishingUseLicenseRequest()
Creates a PublishingUseLicenseRequest object.

References PublishingUseLicenseRequest::CreatePublishingUseLicenseRequest().

◆ SetPublishingFormatJson()

void ProtectionHandler::PublishingSettings::SetPublishingFormatJson ( bool isPublishingFormatJson)
inline

Sets whether or not the returned pl is in json format (xml format is more widely accepted and is the default).

Parameters
isPublishingFormatJsonif json format is enabled.

Definition at line 347 of file protection_handler.h.

347 {
348 mIsPublishingFormatJson = isPublishingFormatJson;
349 }

◆ SetRegenerateContentKey()

void ProtectionHandler::PublishingSettings::SetRegenerateContentKey ( bool regenerateContentKey)
inline

Sets whether or not the content key and ID should be regenerated during republishing.

Parameters
regenerateContentKeyIf the content key and ID should be regenerated.

Definition at line 363 of file protection_handler.h.

363 {
364 mRegenerateContentKey = regenerateContentKey;
365 }

◆ SetRepairLabelIdAllowed()

void ProtectionHandler::PublishingSettings::SetRepairLabelIdAllowed ( bool repairAllowed)
inline

Sets whether or not label id can be added to publishing license on republish.

Parameters
repairAllowedif label info data in protection descriptor can be added to publishing license
Note
This will only take effect if offline protection is used for republishing. Should only be used to add a label to adhoc protection that is missing it.

Definition at line 442 of file protection_handler.h.

442 {
443 mRepairLabelIdAllowed = repairAllowed;
444 }

◆ SetRequestPreLicense()

void ProtectionHandler::PublishingSettings::SetRequestPreLicense ( std::shared_ptr< PublishingUseLicenseRequest > publishingUseLicenseRequest)
inline

Setting this will cause the publishing request to include a pre-license.

Parameters
publishingUseLicenseRequestThe pre-license request
Note
If no pre-license request is specified, a pre-license will not be obtained

Definition at line 412 of file protection_handler.h.

412 {
413 mPublishingUseLicenseRequest = publishingUseLicenseRequest;
414 }

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