---
title: "SecTrustSetOCSPResponse(_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sectrustsetocspresponse(_:_:)"
---

# SecTrustSetOCSPResponse(_:_:)

Attaches Online Certificate Status Protocol (OSCP) response data to a trust object.

## Declaration

```swift
func SecTrustSetOCSPResponse(_ trust: SecTrust, _ responseData: CFTypeRef?) -> OSStatus
```

## Parameters

- `trust`: The trust evaluation object to modify.
- `responseData`: Either a doc://com.apple.documentation/documentation/CoreFoundation/CFData object containing a single DER-encoded OCSPResponse (per https://tools.ietf.org/html/rfc2560), or a doc://com.apple.documentation/documentation/CoreFoundation/CFArray of these.

## Return Value

Return Value A result code. See Security Framework Result Codes.

## Discussion

Discussion This function allows the caller to provide OCSPResponse data (which may be obtained during a TLS/SSL handshake, per RFC3546) as input to a trust evaluation. If this data is available, it can obviate the need to contact an OCSP server for current revocation information.
