<!--
{
  "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/MLKEM1024/PrivateKey/init(seedRepresentation:publicKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit9MLKEM1024O10PrivateKeyV18seedRepresentation06publicE0AEx_AC06PublicE0VSgtKc10Foundation12DataProtocolRzlufc"
  },
  "title" : "init(seedRepresentation:publicKey:)"
}
-->

# init(seedRepresentation:publicKey:)

Initializes a private key from a seed representation and optional public key.

```
init<D>(seedRepresentation: D, publicKey: MLKEM1024.PublicKey?) throws where D : DataProtocol
```

## Parameters

`seedRepresentation`

The seed representation `d||z`, as specified in the `ML-KEM.KeyGen_internal(d,z)` algorithm (Algorithm 16) of FIPS 203.

`publicKey`

An optional public key. Pass this to check that the initialized private key is consistent with the public key. The initializer throws if the public key doesn’t match the expected value.

---

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)