<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit13SecureEnclaveO4P256O7SigningO10PrivateKeyV"
  },
  "title" : "SecureEnclave.P256.Signing.PrivateKey"
}
-->

# SecureEnclave.P256.Signing.PrivateKey

A P-256 private key used for signing.

```
struct PrivateKey
```

## Topics

### Creating a private key

[`init(dataRepresentation:authenticationContext:)`](/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/init(dataRepresentation:authenticationContext:))

Creates a P-256 private key for signing from a data
representation of the key with the given authentication
context.

[`init(compactRepresentable:accessControl:authenticationContext:)`](/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/init(compactRepresentable:accessControl:authenticationContext:))

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

### Representing the key

[`dataRepresentation`](/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/dataRepresentation)

A data representation of the private key.

### Getting the public key

[`publicKey`](/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/publicKey)

The corresponding public key.

### Generating a signature

[`signature(for:)`](/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/signature(for:)-3xogs)

Generates an Elliptic Curve Digital Signature Algorithm (ECDSA)
signature of the digest you provide over the P-256 elliptic curve.

[`signature(for:)`](/documentation/CryptoKit/SecureEnclave/P256/Signing/PrivateKey/signature(for:)-76j0u)

Generates an elliptic curve digital signature algorithm (ECDSA)
signature of the given data over the P-256 elliptic curve, using SHA-256
as the hash function.



---

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)