Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article explains how license expiration works for protected content consumption and how to query the end-user license (EUL) lifetime by using the ProtectionDescriptor APIs in the MIP SDK. Understanding this distinction helps applications decide when to prompt users to reauthenticate.
Overview
When consuming protected content, the MIP SDK retrieves an end-user license (EUL) that grants the user rights to access the content. The EUL may have an expiration time, after which the user must re-acquire the license (typically by connecting online) to continue accessing the content.
Querying license expiration
C++
The mip::ProtectionDescriptor class provides two methods:
// Returns true if the license has an expiration time.
// Note: If DoesAllowOfflineAccess() returns false, the return value is not meaningful.
bool DoesLicenseExpire() const;
// Returns the license expiration time. Returns epoch 0 if the license
// never expires or if there is no license yet (as in protection/publishing cases).
// This field is read-only — it is not used for protection, only consumption.
std::chrono::time_point<std::chrono::system_clock> GetLicenseValidUntil() const;
Important
These methods are meaningful only for consumption scenarios (reading protected content). When creating or publishing protection, GetLicenseValidUntil() returns epoch 0.
Note
When DoesAllowOfflineAccess() returns false, the license expiration values aren't meaningful because the user must always be online.
Example: Checking license expiration during consumption
auto handler = protectionEngine->CreateProtectionHandlerForConsumption(consumptionSettings);
auto descriptor = handler->GetProtectionDescriptor();
if (descriptor->DoesAllowOfflineAccess()) {
if (descriptor->DoesLicenseExpire()) {
auto expiry = descriptor->GetLicenseValidUntil();
auto timeT = std::chrono::system_clock::to_time_t(expiry);
std::cout << "License expires: " << std::ctime(&timeT) << std::endl;
} else {
std::cout << "License does not expire." << std::endl;
}
} else {
std::cout << "Offline access is not allowed. Online validation is always required." << std::endl;
}
Distinction from content expiration
The ProtectionDescriptor exposes two separate expiration concepts:
| Method | Purpose |
|---|---|
DoesContentExpire() / GetContentValidUntil() |
The content expiration time. After this time, the content can no longer be decrypted at all, even with a valid license. |
DoesLicenseExpire() / GetLicenseValidUntil() |
The license cache expiration time. After this time, the user must re-authenticate online to obtain a new license. |
Content expiration is set by the content publisher (protection policy). License expiration is determined by the service when issuing the EUL.