---
title: "SecCertificateCopyData(_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seccertificatecopydata(_:)"
---

# SecCertificateCopyData(_:)

Returns a DER representation of a certificate given a certificate object.

## Declaration

```swift
func SecCertificateCopyData(_ certificate: SecCertificate) -> CFData
```

## Parameters

- `certificate`: The certificate object for which you wish to return the DER (Distinguished Encoding Rules) representation of the X.509 certificate.

## Mentioned in

Storing a DER-Encoded X.509 Certificate

## Return Value

Return Value The DER representation of the certificate. In Objective-C, call the CFRelease function to release this object when you are finished with it. Returns nil if the data passed in the certificate parameter is not a valid certificate object.
