<!--
{
  "availability" : [
    "iOS: 11.2.0 -",
    "iPadOS: 11.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 11.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecIdentityCreate(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecIdentityCreate"
  },
  "title" : "SecIdentityCreate(_:_:_:)"
}
-->

# SecIdentityCreate(_:_:_:)

```
func SecIdentityCreate(_ allocator: CFAllocator?, _ certificate: SecCertificate, _ privateKey: SecKey) -> SecIdentity?
```

## Parameters

`allocator`

CFAllocator to allocate the identity object. Pass NULL to use the default allocator.

`certificate`

A certificate reference.

`privateKey`

A private key reference.

## Return Value

An identity reference.

## Discussion

\abstract create a new identity object from the provided certificate and its associated private key.
\discussion This interface returns null if the private does not key correspond to the public key in the certifcate.

---

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)