<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVContentKeySession/makeSecureTokenForExpirationDate(ofPersistableContentKey:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVContentKeySession(im)makeSecureTokenForExpirationDateOfPersistableContentKey:completionHandler:"
  },
  "title" : "makeSecureTokenForExpirationDate(ofPersistableContentKey:completionHandler:)"
}
-->

# makeSecureTokenForExpirationDate(ofPersistableContentKey:completionHandler:)

Creates a secure server playback context that the client sends to the key server to get an expiration date for the given persistable content key data.

```
func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data, completionHandler handler: @escaping @Sendable (Data?, (any Error)?) -> Void)
```

## Parameters

`persistableContentKeyData`

The previously created persistable content key data.

`handler`

A block called after the secure token is ready.

- secureTokenData: The new secure token.
- error: A parameter that holds the error object that explains the error. If no error occurred, the value of this parameter is `nil`.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)