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

Constructs a ProtectionDescriptor that describes protection associated with a piece of content. More...

#include <src/api/mip/protection_descriptor_builder.h>

Public Types

enum class  LicenseType {
  DoNotForward = 0 ,
  EncryptOnly
}
 License type to create a specialized license. More...
 

Public Member Functions

virtual MIP_API std::shared_ptr< ProtectionDescriptorBuild ()=0
 Creates a ProtectionDescriptor whose access permissions are defined by this ProtectionDescriptorBuilder instance.
 
virtual void SetAllowOfflineAccess (bool value)=0
 Sets if protection policy allows offline content access or not.
 
virtual void SetContentValidUntil (const std::chrono::time_point< std::chrono::system_clock > &value)=0
 Sets protection policy expiration time.
 
virtual void SetDescription (const std::string &value)=0
 Sets protection policy description.
 
virtual void SetDoubleKeyUrl (const std::string &doubleKeyUrl)=0
 Sets the double key url to be used for custom protection.
 
virtual void SetEncryptedAppData (const std::map< std::string, std::string > &value)=0
 Sets app-specific data that should be encrypted.
 
virtual void SetLabelInfo (const LabelInfo &labelId)=0
 Sets the label id and tenant id for UDP protection.
 
virtual void SetName (const std::string &value)=0
 Sets protection policy name.
 
virtual void SetReferrer (const std::string &uri)=0
 Sets protection policy referrer address.
 
virtual void SetSignedAppData (const std::map< std::string, std::string > &value)=0
 Sets app-specific data that should be signed.
 

Static Public Member Functions

static MIP_API std::shared_ptr< ProtectionDescriptorBuilderCreateFromLicenseType (LicenseType licenseType, const std::vector< std::string > &usersWithDefaultRights, const std::vector< UserRights > &additionalUsersAndRights)
 Creates a ProtectionDescriptorBuilder for a license type with the specified users.
 
static MIP_API std::shared_ptr< ProtectionDescriptorBuilderCreateFromProtectionDescriptor (const ProtectionDescriptor &protectionDescriptor)
 Creates a ProtectionDescriptorBuilder whose access permissions are defined by a protection descriptor.
 
static MIP_API std::shared_ptr< ProtectionDescriptorBuilderCreateFromSerializedTemplate (const std::vector< uint8_t > &serializedTemplate)
 Creates a ProtectionDescriptorBuilder whose access permissions are defined by the protection template.
 
static MIP_API std::shared_ptr< ProtectionDescriptorBuilderCreateFromTemplate (const std::string &templateId)
 Creates a ProtectionDescriptorBuilder whose access permissions are defined by the protection template.
 
static MIP_API std::shared_ptr< ProtectionDescriptorBuilderCreateFromUserRights (const std::vector< UserRights > &usersAndRights)
 Creates a ProtectionDescriptorBuilder whose access permissions are defined by users and rights.
 
static MIP_API std::shared_ptr< ProtectionDescriptorBuilderCreateFromUserRoles (const std::vector< UserRoles > &usersAndRoles)
 Creates a ProtectionDescriptorBuilder whose access permissions are defined by users and roles.
 

Detailed Description

Constructs a ProtectionDescriptor that describes protection associated with a piece of content.

Definition at line 49 of file protection_descriptor_builder.h.

Member Enumeration Documentation

◆ LicenseType

License type to create a specialized license.

Enumerator
DoNotForward 

Defines a do not forward license type.

EncryptOnly 

Defines an encrypt only license type.

Definition at line 54 of file protection_descriptor_builder.h.

54 {
55 /**
56 * @brief Defines a do not forward license type
57 */
58 DoNotForward = 0,
59 /**
60 * @brief Defines an encrypt only license type
61 */
63 };
@ EncryptOnly
Defines an encrypt only license type.
@ DoNotForward
Defines a do not forward license type.

Member Function Documentation

◆ Build()

virtual MIP_API std::shared_ptr< ProtectionDescriptor > ProtectionDescriptorBuilder::Build ( )
pure virtual

Creates a ProtectionDescriptor whose access permissions are defined by this ProtectionDescriptorBuilder instance.

Returns
New ProtectionDescriptor instance

◆ CreateFromLicenseType()

static MIP_API std::shared_ptr< ProtectionDescriptorBuilder > ProtectionDescriptorBuilder::CreateFromLicenseType ( LicenseType licenseType,
const std::vector< std::string > & usersWithDefaultRights,
const std::vector< UserRights > & additionalUsersAndRights )
static

Creates a ProtectionDescriptorBuilder for a license type with the specified users.

Parameters
licenseTypeThe license type to create this ProtectionDescriptorBuilder for
usersWithDefaultRightsCollection of users to add to the license with default rights for the specific type
additionalUsersAndRightsOptional additional collection of users-to-rights mappings
Returns
New ProtectionDescriptorBuilder instance

◆ CreateFromProtectionDescriptor()

static MIP_API std::shared_ptr< ProtectionDescriptorBuilder > ProtectionDescriptorBuilder::CreateFromProtectionDescriptor ( const ProtectionDescriptor & protectionDescriptor)
static

Creates a ProtectionDescriptorBuilder whose access permissions are defined by a protection descriptor.

Parameters
protectionDescriptorprotection descriptor
Returns
New ProtectionDescriptorBuilder instance

◆ CreateFromSerializedTemplate()

static MIP_API std::shared_ptr< ProtectionDescriptorBuilder > ProtectionDescriptorBuilder::CreateFromSerializedTemplate ( const std::vector< uint8_t > & serializedTemplate)
static

Creates a ProtectionDescriptorBuilder whose access permissions are defined by the protection template.

Parameters
serializedTemplateprotection template
Returns
New ProtectionDescriptorBuilder instance

◆ CreateFromTemplate()

static MIP_API std::shared_ptr< ProtectionDescriptorBuilder > ProtectionDescriptorBuilder::CreateFromTemplate ( const std::string & templateId)
static

Creates a ProtectionDescriptorBuilder whose access permissions are defined by the protection template.

Parameters
templateIdprotection template ID
Returns
New ProtectionDescriptorBuilder instance

◆ CreateFromUserRights()

static MIP_API std::shared_ptr< ProtectionDescriptorBuilder > ProtectionDescriptorBuilder::CreateFromUserRights ( const std::vector< UserRights > & usersAndRights)
static

Creates a ProtectionDescriptorBuilder whose access permissions are defined by users and rights.

Parameters
usersAndRightsCollection of users-to-rights mappings
Returns
New ProtectionDescriptorBuilder instance

◆ CreateFromUserRoles()

static MIP_API std::shared_ptr< ProtectionDescriptorBuilder > ProtectionDescriptorBuilder::CreateFromUserRoles ( const std::vector< UserRoles > & usersAndRoles)
static

Creates a ProtectionDescriptorBuilder whose access permissions are defined by users and roles.

Parameters
usersAndRolesCollection of users-to-roles mappings
Returns
New ProtectionDescriptorBuilder instance

◆ SetAllowOfflineAccess()

virtual void ProtectionDescriptorBuilder::SetAllowOfflineAccess ( bool value)
pure virtual

Sets if protection policy allows offline content access or not.

Parameters
valueIf policy allows offline content access or not

◆ SetContentValidUntil()

virtual void ProtectionDescriptorBuilder::SetContentValidUntil ( const std::chrono::time_point< std::chrono::system_clock > & value)
pure virtual

Sets protection policy expiration time.

Parameters
valuePolicy expiration time

◆ SetDescription()

virtual void ProtectionDescriptorBuilder::SetDescription ( const std::string & value)
pure virtual

Sets protection policy description.

Parameters
valuePolicy description

◆ SetDoubleKeyUrl()

virtual void ProtectionDescriptorBuilder::SetDoubleKeyUrl ( const std::string & doubleKeyUrl)
pure virtual

Sets the double key url to be used for custom protection.

Parameters
doubleKeyUrlDouble key url

◆ SetEncryptedAppData()

virtual void ProtectionDescriptorBuilder::SetEncryptedAppData ( const std::map< std::string, std::string > & value)
pure virtual

Sets app-specific data that should be encrypted.

Parameters
valueApp-specific data
Note
An application can specify a dictionary of app-specific data that will be encrypted by the protection service. This encrypted data is independent of the signed data set by SetSignedAppData.

◆ SetLabelInfo()

virtual void ProtectionDescriptorBuilder::SetLabelInfo ( const LabelInfo & labelId)
pure virtual

Sets the label id and tenant id for UDP protection.

Only allowed for custom protection type.

Parameters
LabelInfolabel info containing labelId and tenantId.

◆ SetName()

virtual void ProtectionDescriptorBuilder::SetName ( const std::string & value)
pure virtual

Sets protection policy name.

Parameters
valueProtection policy name

◆ SetReferrer()

virtual void ProtectionDescriptorBuilder::SetReferrer ( const std::string & uri)
pure virtual

Sets protection policy referrer address.

Parameters
uriPolicy referrer address
Note
The referrer is a URI that can be displayed to the user upon failed protection policy acquisition that contains information on how that user can gain permission to access the content.

◆ SetSignedAppData()

virtual void ProtectionDescriptorBuilder::SetSignedAppData ( const std::map< std::string, std::string > & value)
pure virtual

Sets app-specific data that should be signed.

Parameters
valueApp-specific data
Note
An application can specify a dictionary of app-specific data that will be signed by the protection service. This signed data is independent of the encrypted data set by SetEncryptedAppData.

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