---
title: AVContentKeySession
framework: avfoundation
role: symbol
role_heading: Class
path: avfoundation/avcontentkeysession
---

# AVContentKeySession

An object that creates and tracks decryption keys for media data.

## Declaration

```swift
class AVContentKeySession
```

## Topics

### Creating a session

- [init(keySystem:)](avfoundation/avcontentkeysession/init(keysystem:).md)
- [init(keySystem:storageDirectoryAt:)](avfoundation/avcontentkeysession/init(keysystem:storagedirectoryat:).md)

### Inspecting the session

- [keySystem](avfoundation/avcontentkeysession/keysystem.md)
- [AVContentKeySystem](avfoundation/avcontentkeysystem.md)
- [storageURL](avfoundation/avcontentkeysession/storageurl.md)

### Managing the delegate object

- [setDelegate(_:queue:)](avfoundation/avcontentkeysession/setdelegate(_:queue:).md)
- [delegate](avfoundation/avcontentkeysession/delegate.md)
- [delegateQueue](avfoundation/avcontentkeysession/delegatequeue.md)

### Managing content key recipients

- [contentKeyRecipients](avfoundation/avcontentkeysession/contentkeyrecipients.md)
- [AVContentKeyRecipient](avfoundation/avcontentkeyrecipient.md)
- [addContentKeyRecipient(_:)](avfoundation/avcontentkeysession/addcontentkeyrecipient(_:).md)
- [removeContentKeyRecipient(_:)](avfoundation/avcontentkeysession/removecontentkeyrecipient(_:).md)

### Processing requests

- [processContentKeyRequest(withIdentifier:initializationData:options:)](avfoundation/avcontentkeysession/processcontentkeyrequest(withidentifier:initializationdata:options:).md)

### Managing expiration

- [expire()](avfoundation/avcontentkeysession/expire().md)
- [makeSecureTokenForExpirationDate(ofPersistableContentKey:completionHandler:)](avfoundation/avcontentkeysession/makesecuretokenforexpirationdate(ofpersistablecontentkey:completionhandler:).md)
- [renewExpiringResponseData(for:)](avfoundation/avcontentkeysession/renewexpiringresponsedata(for:).md)
- [contentProtectionSessionIdentifier](avfoundation/avcontentkeysession/contentprotectionsessionidentifier.md)

### Invalidating content keys

- [invalidatePersistableContentKey(_:options:completionHandler:)](avfoundation/avcontentkeysession/invalidatepersistablecontentkey(_:options:completionhandler:).md)
- [invalidateAllPersistableContentKeys(forApp:options:completionHandler:)](avfoundation/avcontentkeysession/invalidateallpersistablecontentkeys(forapp:options:completionhandler:).md)
- [AVContentKeySessionServerPlaybackContextOption](avfoundation/avcontentkeysessionserverplaybackcontextoption.md)

### Handling expired session reports

- [pendingExpiredSessionReports(withAppIdentifier:storageDirectoryAt:)](avfoundation/avcontentkeysession/pendingexpiredsessionreports(withappidentifier:storagedirectoryat:).md)
- [removePendingExpiredSessionReports(_:withAppIdentifier:storageDirectoryAt:)](avfoundation/avcontentkeysession/removependingexpiredsessionreports(_:withappidentifier:storagedirectoryat:).md)

### Initializers

- [init(keySystem:storageDirectoryAtURL:)](avfoundation/avcontentkeysession/init(keysystem:storagedirectoryaturl:).md)

### Instance Properties

- [supportsAdvisoryKeys](avfoundation/avcontentkeysession/supportsadvisorykeys.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### FairPlay streaming

- [AVContentKeySessionDelegate](avfoundation/avcontentkeysessiondelegate.md)
- [AVContentKey](avfoundation/avcontentkey.md)
- [AVContentKeySpecifier](avfoundation/avcontentkeyspecifier.md)
- [AVContentKeyRequest](avfoundation/avcontentkeyrequest.md)
- [AVPersistableContentKeyRequest](avfoundation/avpersistablecontentkeyrequest.md)
- [AVContentKeyResponse](avfoundation/avcontentkeyresponse.md)
- [AVExternalContentProtectionStatus](avfoundation/avexternalcontentprotectionstatus.md)
- [AVSampleBufferAttachContentKey(_:_:_:)](avfoundation/avsamplebufferattachcontentkey(_:_:_:).md)
