<!--
{
  "availability" : [
    "iOS: 9.0.0 - 18.0.0",
    "iPadOS: 9.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.15.0 - 15.0.0",
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetResourceLoadingRequest/persistentContentKey(fromKeyVendorResponse:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetResourceLoadingRequest(im)persistentContentKeyFromKeyVendorResponse:options:error:"
  },
  "title" : "persistentContentKey(fromKeyVendorResponse:options:)"
}
-->

# persistentContentKey(fromKeyVendorResponse:options:)

Obtains a persistable content key from a context.

```
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 [`streamingContentKeyRequestData(forApp:contentIdentifier:options:)`](/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

The persistable content key.

## Discussion

The data returned from this method may be used to immediately satisfy an [`AVAssetResourceLoadingDataRequest`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest), as well as any subsequent requests for the same key URL. The value of [`contentType`](/documentation/AVFoundation/AVAssetResourceLoadingContentInformationRequest/contentType) must be set to [`AVStreamingKeyDeliveryPersistentContentKeyType`](/documentation/AVFoundation/AVStreamingKeyDeliveryPersistentContentKeyType) when responding with data created with this method.

---

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)