---
title: "SecIdentityCreate(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/secidentitycreate(_:_:_:)"
---

# SecIdentityCreate(_:_:_:)

## Declaration

```swift
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

Return Value An identity reference.

## Discussion

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