Microsoft Information Protection (MIP) SDK for C++: Reference 1.16
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 correlate 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 GetShouldRefreshTemplates () const
 Gets whether or not templates should be forcibly refreshed during offline publishing.
 
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.
 
void SetShouldRefreshTemplates (bool shouldRefreshTemplates)
 Sets whether or not templates should be forcibly refreshed during offline publishing.
 

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),
242 mShouldRefreshTemplates(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 250 of file protection_handler.h.

253 : mProtectionDescriptor(protectionDescriptor),
254 mRepublishingLicense(serializedPublishingLicense),
255 mIsAuditedExtractionAllowed(false),
256 mIsDeprecatedAlgorithmPreferred(false),
257 mIsPublishingFormatJson(false),
258 mRepairLabelIdAllowed(false),
259 mRegenerateContentKey(false),
260 mShouldRefreshTemplates(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 268 of file protection_handler.h.

271 : mProtectionDescriptor(protectionDescriptor),
272 mProtectionHandler(protectionHandler),
273 mIsAuditedExtractionAllowed(false),
274 mIsDeprecatedAlgorithmPreferred(false),
275 mIsPublishingFormatJson(false),
276 mRepairLabelIdAllowed(false),
277 mRegenerateContentKey(false),
278 mShouldRefreshTemplates(false) {}

Member Function Documentation

◆ GetApplicationScenarioId()

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

Gets the scenario Id provided by the application which is used to correlate 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 335 of file protection_handler.h.

335{ 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 292 of file protection_handler.h.

292{ 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 308 of file protection_handler.h.

308{ 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 424 of file protection_handler.h.

424 {
425 return mPublishingUseLicenseRequest;
426 }

◆ GetPreLicenseUserEmail()

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

Gets the pre-license user.

Returns
Pre-license user

Definition at line 395 of file protection_handler.h.

395 {
396 static std::string empty;
397 return mPublishingUseLicenseRequest != nullptr ? mPublishingUseLicenseRequest->GetDelegatedUserEmail() : empty; }

◆ GetProtectionDescriptor()

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

Definition at line 280 of file protection_handler.h.

280{ return mProtectionDescriptor; }

◆ GetProtectionHandlerForRepublish()

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

Gets protection handler for republishing scenario.

Definition at line 285 of file protection_handler.h.

285{ 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 404 of file protection_handler.h.

404 {
405 return mRepublishingLicense;
406 }

◆ 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 359 of file protection_handler.h.

359{ 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 435 of file protection_handler.h.

435{ return mRepairLabelIdAllowed; }

◆ GetShouldRefreshTemplates()

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

Gets whether or not templates should be forcibly refreshed during offline publishing.

Returns
True if templates will be refreshed, false if template refresh will be decided by age of current templates

Definition at line 454 of file protection_handler.h.

454 {
455 return mShouldRefreshTemplates;
456 }

◆ 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 343 of file protection_handler.h.

343{ return mIsPublishingFormatJson; }

◆ SetApplicationScenarioId()

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

Sets the scenario Id provided by the application.

Parameters
applicationScenarioIdapplication scenario Id which is used to correlate with the server.

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 326 of file protection_handler.h.

326{ 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 299 of file protection_handler.h.

299 {
300 mIsAuditedExtractionAllowed = isAuditedExtractionAllowed;
301 }

◆ 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 315 of file protection_handler.h.

315 {
316 mIsDeprecatedAlgorithmPreferred = isDeprecatedAlgorithmPreferred;
317 }

◆ 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 380 of file protection_handler.h.

380 {
381 if(mPublishingUseLicenseRequest == nullptr) {
383 }
384 mPublishingUseLicenseRequest->SetDelegatedUserEmail(preLicenseUserEmail);
385 }
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 350 of file protection_handler.h.

350 {
351 mIsPublishingFormatJson = isPublishingFormatJson;
352 }

◆ 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 366 of file protection_handler.h.

366 {
367 mRegenerateContentKey = regenerateContentKey;
368 }

◆ 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 445 of file protection_handler.h.

445 {
446 mRepairLabelIdAllowed = repairAllowed;
447 }

◆ 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 415 of file protection_handler.h.

415 {
416 mPublishingUseLicenseRequest = publishingUseLicenseRequest;
417 }

◆ SetShouldRefreshTemplates()

void ProtectionHandler::PublishingSettings::SetShouldRefreshTemplates ( bool shouldRefreshTemplates)
inline

Sets whether or not templates should be forcibly refreshed during offline publishing.

Parameters
shouldRefreshTemplatesIf templates should be forcibly refreshed

Definition at line 463 of file protection_handler.h.

463 {
464 mShouldRefreshTemplates = shouldRefreshTemplates;
465 }

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