9 #ifndef _RMS_LIB_USERPOLICY_H_
10 #define _RMS_LIB_USERPOLICY_H_
15 #include "IAuthenticationCallback.h"
16 #include "IConsentCallback.h"
17 #include "ModernAPIExport.h"
18 #include "CacheControl.h"
19 #include "TemplateDescriptor.h"
20 #include "PolicyDescriptor.h"
24 class ProtectionPolicy;
28 class TemplateDescriptor;
29 class PolicyDescriptor;
34 enum GetUserPolicyResultStatus {
60 std::shared_ptr<std::string>referrer,
61 std::shared_ptr<UserPolicy> policy);
82 enum PolicyAcquisitionOptions {
105 enum UserPolicyCreationOptions {
111 USER_AllowAuditedExtraction = 0x1,
117 USER_PreferDeprecatedAlgorithms = 0x2,
123 enum UserPolicyType {
163 static std::shared_ptr<GetUserPolicyResult>Acquire(
164 const std::vector<unsigned char>& serializedPolicy,
165 const std::string & userId,
168 PolicyAcquisitionOptions options,
169 ResponseCacheFlags cacheMask);
187 static std::shared_ptr<UserPolicy>CreateFromTemplateDescriptor(
189 const std::string & userId,
191 UserPolicyCreationOptions options,
192 const AppDataHashMap & signedAppData);
209 static std::shared_ptr<UserPolicy>Create(
211 const std::string & userId,
213 UserPolicyCreationOptions options);
223 const std::string& right)
const;
228 UserPolicyType Type();
238 std::string Description();
258 std::string IssuedTo();
263 bool IsIssuedToOwner();
268 std::string ContentId();
273 const AppDataHashMap EncryptedAppData();
278 const AppDataHashMap SignedAppData();
283 std::chrono::time_point<std::chrono::system_clock>ContentValidUntil();
288 bool DoesUseDeprecatedAlgorithms();
293 bool IsAuditedExtractAllowed();
298 const std::vector<unsigned char> SerializedPolicy();
304 std::shared_ptr<core::ProtectionPolicy> GetImpl();
308 UserPolicy(std::shared_ptr<core::ProtectionPolicy>pImpl);
310 std::shared_ptr<core::ProtectionPolicy> m_pImpl;
311 std::shared_ptr<modernapi::TemplateDescriptor> m_templateDescriptor;
312 std::shared_ptr<modernapi::PolicyDescriptor> m_policyDescriptor;
316 #endif // _RMS_LIB_USERPOLICY_H_
Represents the policy associated with protected content.
Definition: UserPolicy.h:138
Definition: AuthenticationCallbackImpl.h:16
Specifies users and rights assigned for a file. This is information used for custom protection...
Definition: PolicyDescriptor.h:49
Implement this interface to provide an approach for getting an OAuth access token.
Definition: IAuthenticationCallback.h:25
The result of the UserPolicy::Acquire operation.
Definition: UserPolicy.h:55
GetUserPolicyResultStatus Status
User policy result status.
Definition: UserPolicy.h:65
std::shared_ptr< std::string > Referrer
The policy referrer.
Definition: UserPolicy.h:70
Template information.
Definition: TemplateDescriptor.h:23
std::shared_ptr< UserPolicy > Policy
Pointer to the policy object.
Definition: UserPolicy.h:75
Callback to be provided by library user to notify app user of actions to be taken and request their c...
Definition: IConsentCallback.h:24