How can the application read the license duration?

Offline FairPlay supports a new "dual expiry" feature - the license can have a Storage Duration and a Playback duration. As the example shows, a typical setup for storage duration is 30 days and for playback duration 24 hours.


  1. Is there an API that allows me to read those values from the CKC, or I have to parse the binary data and extract it from there?
  2. After first playback has started, is there a way to get the remaining playback time? It's better to know in advance (and show the user that an asset is not playable) than to fail on playback.


Thanks!

Noam.

Apple, please help.😕

noamtk,


There are no API's for the app to query as to when the content credentials will expire. As the connection between the app and the KSM is up to the developer, the app could query the KSM for this information.


makeSecureTokenForExpirationDate(ofPersistableContentKey:completionHandler:)

https://developer.apple.com/documentation/avfoundation/avcontentkeysession/2887476-makesecuretokenforexpirationdate


This method essentially returns an SPC that the key server could decrypt to lookup “duration to expiry” for a given persistent key. Note that this requires the app to be online. Offline apps need to track the expiry time on their own.

Hi Noam, You’ll need to communicate this information out of band of the CKC itself. Please file a feature request at bugreporter.apple.com if you’d like us to be able to provide that informatIon back to the app somehow.

Hi,

The rent expiration time I can probably manage myself (if, as you suggest, I save the offline expiration time). However, the playback expiration is different in that it's a stateful property: the counter starts on first play.

Being able to ask an API would help.

Thanks.

Hi,

I am also wondering if it is possible to get information from license (after download them) how long asset will be available for playback after first play.


In my case, playback expiration will be different for different assets. Till now I was using resourceLoader to download and store DRM license for future use. It works fine but now I need to present users information about Storage Duration and Playback duration. I suposed moving on AVContentKeySession will give me possibility to read somehow this inforamtion.

Please see Radar 41982063.

Thanks for filing the request!

I got a notice from Radar that the bug is a dupe of something else (that was opened a long time ago). But with Apple's bug tracker being close, I don't really know if it's being worked on.

Hi noamtk, can I ask how you handle the storage expiration? like I downloaded a content for 30 days to start, but after 29 days I haven't started watching, then I want to renew the license to another 30 days to start.

Or I can just delete the license and request again?

How can the application read the license duration?
 
 
Q