RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
Public Member Functions | Static Public Member Functions | List of all members
rmscore::modernapi::UserPolicy Class Reference

Represents the policy associated with protected content. More...

#include <UserPolicy.h>

Public Member Functions

bool AccessCheck (const std::string &right) const
 Returns a value that indicates whether the current user has the specified right. More...
 
UserPolicyType Type ()
 Gets the policy type; template based or custom.
 
std::string Name ()
 Gets the name of the policy.
 
std::string Description ()
 Gets the policy description.
 
std::shared_ptr< modernapi::TemplateDescriptorTemplateDescriptor ()
 Gets the template used to publish the content.
 
std::shared_ptr< modernapi::PolicyDescriptorPolicyDescriptor ()
 Gets the policy descriptor.
 
std::string Owner ()
 Gets the email address of the content owner.
 
std::string IssuedTo ()
 Gets the user associated with the protection policy.
 
bool IsIssuedToOwner ()
 Gets the flag indicating if the current user the is the content owner.
 
std::string ContentId ()
 Gets the unique content ID associated with the protected document.
 
const AppDataHashMap EncryptedAppData ()
 Gets the encrypted app specific data.
 
const AppDataHashMap SignedAppData ()
 Gets the signed app specific data.
 
std::chrono::time_point< std::chrono::system_clock > ContentValidUntil ()
 The date the content is valid until.
 
bool DoesUseDeprecatedAlgorithms ()
 Gets the deprecated algorithms flag.
 
bool IsAuditedExtractAllowed ()
 Gets property for allowance of audited extraction.
 
const std::vector< unsigned char > SerializedPolicy ()
 Gets the serialized policy.
 
std::shared_ptr< core::ProtectionPolicy > GetImpl ()
 Gets a pointer to ProtectionPolicy. BRP072215 - meaning? More...
 

Static Public Member Functions

static std::shared_ptr< GetUserPolicyResultAcquire (const std::vector< unsigned char > &serializedPolicy, const std::string &userId, IAuthenticationCallback &authenticationCallback, IConsentCallback &consentCallback, PolicyAcquisitionOptions options, ResponseCacheFlags cacheMask)
 Acquire a policy. More...
 
static std::shared_ptr< UserPolicyCreateFromTemplateDescriptor (const TemplateDescriptor &templateDescriptor, const std::string &userId, IAuthenticationCallback &authenticationCallback, UserPolicyCreationOptions options, const AppDataHashMap &signedAppData)
 For publishing using templates. More...
 
static std::shared_ptr< UserPolicyCreate (PolicyDescriptor &policyDescriptor, const std::string &userId, IAuthenticationCallback &authenticationCallback, UserPolicyCreationOptions options)
 Create a custom protection policy. More...
 

Detailed Description

Represents the policy associated with protected content.

Member Function Documentation

bool rmscore::modernapi::UserPolicy::AccessCheck ( const std::string &  right) const

Returns a value that indicates whether the current user has the specified right.

Parameters
rightThe right to check.
Returns
True if the current user has the right; otherwise false. Note - When called on behalf of the content owner, returns True for any right that is specified.
shared_ptr< GetUserPolicyResult > rmscore::modernapi::UserPolicy::Acquire ( const std::vector< unsigned char > &  serializedPolicy,
const std::string &  userId,
IAuthenticationCallback authenticationCallback,
IConsentCallback consentCallback,
PolicyAcquisitionOptions  options,
ResponseCacheFlags  cacheMask 
)
static

Acquire a policy.

Parameters
serializedPolicyThe PL to be consumed.
userIdThe email address of the user that is trying to consume the protected content. This email address will be used to determine which policy object to use from the offline cache. If a policy object for this user is not found in the offline cache then this API will go online (if allowed) to get the policy object. If null is passed, the first policy object found in the offline cache will be used. And again if there is no policy object found for this content in the offline cache, this API will go online to get the policy object. This parameter is also used as a hint for userId for user authentication, i.e., it will be passed to the IAuthenticationCallback.GetTokenAsync() in the AuthenticationParameters structure.
authenticationCallbackAuthentication callback to be used for authentication process.
consentCallbackConsent callback for user consent process.
optionsOffline flag
cacheMaskMask of caching response options from server, a combination of ResponseCacheFlags. For example if you set OnDisk and Crypted flags, the server response will be stored to disk and encrypted by a unique generated key for the current user.
Returns
Pointer a GetUserPolicyResult structure.
std::shared_ptr< UserPolicy > rmscore::modernapi::UserPolicy::Create ( PolicyDescriptor policyDescriptor,
const std::string &  userId,
IAuthenticationCallback authenticationCallback,
UserPolicyCreationOptions  options 
)
static

Create a custom protection policy.

Parameters
policyDescriptorA PolicyDescriptor object which defines the policy.
userIdThe email address of the user that is protecting the content. This email address will be used to discover the RMS service instance, either ADRMS server or Azure RMS, that the user's organization is using. This parameter is also used as a hint for userId for user authentication, i.e., it will be passed to the IAuthenticationCallback.GetTokenAsync() in the AuthenticationParameters structure.
authenticationCallbackAuthentication callback to be used for authentication.
optionsOptions for creating protection policy object. For more information, see UserPolicyCreationOptions.
Returns
Pointer to a UserPolicy object.
std::shared_ptr< UserPolicy > rmscore::modernapi::UserPolicy::CreateFromTemplateDescriptor ( const TemplateDescriptor templateDescriptor,
const std::string &  userId,
IAuthenticationCallback authenticationCallback,
UserPolicyCreationOptions  options,
const AppDataHashMap &  signedAppData 
)
static

For publishing using templates.

Parameters
templateDescriptorThe template from which the policy is being created.
userIdThe email address of the user that is protecting the content. This email address will be used to discover the RMS service instance, either ADRMS server or Azure RMS, that the user's organization is using. This parameter is also used as a hint for userId for user authentication, i.e., it will be passed to the IAuthenticationCallback.GetTokenAsync in the AuthenticationParameters structure.
authenticationCallbackAuthentication callback to be used for the authentication process.
optionsOptions for creating protection policy object. For more information, see UserPolicyCreationOptions.
signedAppDataSinged App data to be stored with this template.
Returns
Pointer to a UserPolicy object.
shared_ptr< ProtectionPolicy > rmscore::modernapi::UserPolicy::GetImpl ( )

Gets a pointer to ProtectionPolicy. BRP072215 - meaning?

Returns

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