---
title: "persistentContentKey(fromKeyVendorResponse:options:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassetresourceloadingrequest/persistentcontentkey(fromkeyvendorresponse:options:)"
---

# persistentContentKey(fromKeyVendorResponse:options:)

Obtains a persistable content key from a context.

## Declaration

```swift
func persistentContentKey(fromKeyVendorResponse keyVendorResponse: Data, options: [String : Any]? = nil) throws -> Data
```

## Parameters

- `keyVendorResponse`: The response returned from the key vendor as a result of a request generated from doc://com.apple.avfoundation/documentation/AVFoundation/AVAssetResourceLoadingRequest/streamingContentKeyRequestData(forApp:contentIdentifier:options:).
- `options`: Additional information necessary to obtain the key, or nil if no additional information is required.

## Return Value

Return Value The persistable content key.

## Discussion

Discussion The data returned from this method may be used to immediately satisfy an AVAssetResourceLoadingDataRequest, as well as any subsequent requests for the same key URL. The value of contentType must be set to AVStreamingKeyDeliveryPersistentContentKeyType when responding with data created with this method.

## See Also

### Accessing the request data

- [request](avfoundation/avassetresourceloadingrequest/request.md)
- [requestor](avfoundation/avassetresourceloadingrequest/requestor.md)
- [contentInformationRequest](avfoundation/avassetresourceloadingrequest/contentinformationrequest.md)
- [dataRequest](avfoundation/avassetresourceloadingrequest/datarequest.md)
- [redirect](avfoundation/avassetresourceloadingrequest/redirect.md)
- [streamingContentKeyRequestData(forApp:contentIdentifier:options:)](avfoundation/avassetresourceloadingrequest/streamingcontentkeyrequestdata(forapp:contentidentifier:options:).md)
- [AVAssetResourceLoadingRequestStreamingContentKeyRequestRequiresPersistentKey](avfoundation/avassetresourceloadingrequeststreamingcontentkeyrequestrequirespersistentkey.md)
