<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/MLDSA65/PrivateKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Apple CryptoKit",
      "CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit7MLDSA65O10PrivateKeyV"
  },
  "title" : "MLDSA65.PrivateKey"
}
-->

# MLDSA65.PrivateKey

The private key for MLDSA65.

```
struct PrivateKey
```

## Topics

### Creating a private key

[`init() throws`](/documentation/CryptoKit/MLDSA65/PrivateKey/init())

Creates a random MLDSA65 private key.

[`init<D>(integrityCheckedRepresentation: D) throws`](/documentation/CryptoKit/MLDSA65/PrivateKey/init(integrityCheckedRepresentation:))

Initializes a private key from an integrity-checked data representation.

[`init<D>(seedRepresentation: D, publicKey: MLDSA65.PublicKey?) throws`](/documentation/CryptoKit/MLDSA65/PrivateKey/init(seedRepresentation:publicKey:))

Initializes a private key from the seed representation.

### Inspecting a private key’s properties

[`var integrityCheckedRepresentation: Data`](/documentation/CryptoKit/MLDSA65/PrivateKey/integrityCheckedRepresentation)

The integrity-checked data representation of the private key.

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

The associated public key.

[`var seedRepresentation: Data`](/documentation/CryptoKit/MLDSA65/PrivateKey/seedRepresentation)

The seed representation of the private key.

### Signing data

[`func signature<D>(for: D) throws -> Data`](/documentation/CryptoKit/MLDSA65/PrivateKey/signature(for:))

Generates a MLDSA65 signature.

[`func signature<D, C>(for: D, context: C) throws -> Data`](/documentation/CryptoKit/MLDSA65/PrivateKey/signature(for:context:))

Generates a MLDSA65 signature, with context.

## 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)