<!--
{
  "availability" : [
    "tvOS: 13.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SecureEnclave/P256/KeyAgreement/PrivateKey/init(compactRepresentable:accessControl:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit13SecureEnclaveO4P256O12KeyAgreementO07PrivateF0V20compactRepresentable13accessControlAISb_So09SecAccessL3RefatKcfc"
  },
  "title" : "init(compactRepresentable:accessControl:)"
}
-->

# init(compactRepresentable:accessControl:)

Creates a P-256 private key for key agreement with the
specified access control.

```
init(compactRepresentable: Bool = true, accessControl: SecAccessControl = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, [], nil)!) throws
```

## Parameters

`compactRepresentable`

A Boolean value that indicates
whether CryptoKit creates the key with the structure to
enable compact point encoding.

`accessControl`

The protection type and flags to use
when creating the associated access control object.

---

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)