<!--
{
  "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/P384/Signing/PrivateKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit4P384O7SigningO10PrivateKeyV"
  },
  "title" : "P384.Signing.PrivateKey"
}
-->

# P384.Signing.PrivateKey

A P-384 private key used to create cryptographic signatures.

```
struct PrivateKey
```

## Topics

### Creating a private key

[`init<Bytes>(rawRepresentation: Bytes) throws`](/documentation/CryptoKit/P384/Signing/PrivateKey/init(rawRepresentation:))

Creates a P-384 private key for signing from a collection of bytes.

[`init(compactRepresentable: Bool)`](/documentation/CryptoKit/P384/Signing/PrivateKey/init(compactRepresentable:))

Creates a random P-384 private key for signing.

[`init<Bytes>(derRepresentation: Bytes) throws`](/documentation/CryptoKit/P384/Signing/PrivateKey/init(derRepresentation:))

Creates a P-384 private key for signing from a Distinguished Encoding
Rules (DER) encoded representation.

[`init(pemRepresentation: String) throws`](/documentation/CryptoKit/P384/Signing/PrivateKey/init(pemRepresentation:))

Creates a P-384 private key for signing from a Privacy-Enhanced Mail
PEM) representation.

[`init<Bytes>(x963Representation: Bytes) throws`](/documentation/CryptoKit/P384/Signing/PrivateKey/init(x963Representation:))

Creates a P-384 private key for signing from an ANSI x9.63
representation.

### Representing the key

[`var rawRepresentation: Data`](/documentation/CryptoKit/P384/Signing/PrivateKey/rawRepresentation)

A data representation of the private key.

[`var derRepresentation: Data`](/documentation/CryptoKit/P384/Signing/PrivateKey/derRepresentation)

A Distinguished Encoding Rules (DER) encoded representation of the private key.

[`var pemRepresentation: String`](/documentation/CryptoKit/P384/Signing/PrivateKey/pemRepresentation)

A Privacy-Enhanced Mail (PEM) representation of the private key.

[`var x963Representation: Data`](/documentation/CryptoKit/P384/Signing/PrivateKey/x963Representation)

An ANSI x9.63 representation of the private key.

### Finding the public key

[`var publicKey: P384.Signing.PublicKey`](/documentation/CryptoKit/P384/Signing/PrivateKey/publicKey)

The corresponding public key.

### Creating a signature

[`func signature<D>(for: D) throws -> P384.Signing.ECDSASignature`](/documentation/CryptoKit/P384/Signing/PrivateKey/signature(for:)-8nncg)

Generates an Elliptic Curve Digital Signature Algorithm (ECDSA)
signature of the data you provide over the P-384 elliptic curve,
using SHA-384 as the hash function.

[`func signature<D>(for: D) throws -> P384.Signing.ECDSASignature`](/documentation/CryptoKit/P384/Signing/PrivateKey/signature(for:)-wrsj)

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

[`struct ECDSASignature`](/documentation/CryptoKit/P384/Signing/ECDSASignature)

A P-384 elliptic curve digital signature algorithm (ECDSA) signature.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)