<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.5.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecureDownloadCreateWithTicket",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecureDownloadCreateWithTicket"
  },
  "title" : "SecureDownloadCreateWithTicket"
}
-->

# SecureDownloadCreateWithTicket

Creates a secure download object for use during the download process.

```
OSStatus SecureDownloadCreateWithTicket(CFDataRef ticket, SecureDownloadTrustSetupCallback setup, void *setupContext, SecureDownloadTrustEvaluateCallback evaluate, void *evaluateContext, SecureDownloadRef*downloadRef);
```

## Parameters

`ticket`

The download ticket.

`setup`

A pointer to a function that Secure Download calls before trust is verified for each signer of the ticket. This allows you to modify the [`SecTrust`](/documentation/Security/SecTrust) if needed.  The callback returns a [`SecureDownloadTrustCallbackResult`](/documentation/Security/SecureDownloadTrustCallbackResult).

`setupContext`

An arbitrary context passed to the `setup` callback.

`evaluate`

A pointer to a function that Secure Download calls after calling [`SecTrustEvaluate(_:_:)`](/documentation/Security/SecTrustEvaluate(_:_:)) for a signer if the result was not trusted. This allows you to query the user as to whether or not to trust the signer by returning a [`SecTrustResultType`](/documentation/Security/SecTrustResultType) value.

`evaluateContext`

An arbitrary context passed to the `evaluate` callback.

`downloadRef`

A pointer that is set to the new download reference.

## Return Value

A result code. See [Secure Download Result Codes](/documentation/Security/secure-download-result-codes).

## 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)