<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/init(compactRepresentable:accessControl:authenticationContext:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit13SecureEnclaveO4P256O7SigningO10PrivateKeyV20compactRepresentable13accessControl21authenticationContextAISb_So09SecAccessL3RefaSo9LAContextCSgtKcfc"
  },
  "title" : "init(compactRepresentable:accessControl:authenticationContext:)"
}
-->

# init(compactRepresentable:accessControl:authenticationContext:)

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

```
init(compactRepresentable: Bool = true, accessControl: SecAccessControl = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly, [], nil)!, authenticationContext: LAContext? = 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.

`authenticationContext`

A local authentication context.

---

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)