---
title: "makeSecureTokenForExpirationDate(ofPersistableContentKey:completionHandler:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcontentkeysession/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.

## Declaration

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

```swift
func makeSecureTokenForExpirationDate(ofPersistableContentKey persistableContentKeyData: Data) async throws -> Data
```

## Parameters

- `persistableContentKeyData`: The previously created persistable content key data.
- `handler`: A block called after the secure token is ready.

## See Also

### Managing expiration

- [expire()](avfoundation/avcontentkeysession/expire().md)
- [renewExpiringResponseData(for:)](avfoundation/avcontentkeysession/renewexpiringresponsedata(for:).md)
- [contentProtectionSessionIdentifier](avfoundation/avcontentkeysession/contentprotectionsessionidentifier.md)
