<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecCertificateCopyValues(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecCertificateCopyValues"
  },
  "title" : "SecCertificateCopyValues(_:_:_:)"
}
-->

# SecCertificateCopyValues(_:_:_:)

Creates a dictionary that represents a certificate’s contents.

```
func SecCertificateCopyValues(_ certificate: SecCertificate, _ keys: CFArray?, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> CFDictionary?
```

## Parameters

`certificate`

The certificate from which values should be copied.

`keys`

An array of string OID values, or `NULL`. If non-`NULL`, these OID values determine which values from the certificate to return. If `NULL`, all values are returned.

    Only OIDs that represent top-level keys in the returned dictionary can be specified. Unknown OIDs are ignored. See [Certificate OIDs](/documentation/Security/certificate-oids)     for the list of known OIDs.

`error`

A pointer to a <doc://com.apple.documentation/documentation/CoreFoundation/CFError> variable where an error object is stored upon failure. If not `NULL`, the caller is responsible for checking this variable and releasing the resulting object if it exists.

## Return Value

A dictionary containing the specified values from the certificate or `NULL` if an error occurs. In Objective-C, free this dictionary with a call to the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function when you are done with it.

## Discussion

Each entry in this dictionary is itself a dictionary with the keys described in [Certificate Property Keys](/documentation/Security/certificate-property-keys).

---

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)