<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/KEMOneTimePrivateKey",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit20KEMOneTimePrivateKeyP"
  },
  "title" : "KEMOneTimePrivateKey"
}
-->

# KEMOneTimePrivateKey

A one-time private key for a key encapsulation mechanism, which can only decapsulate once but it does so faster.

```
@preconcurrency protocol KEMOneTimePrivateKey : Sendable, ~Copyable
```

## Topics

### Associated Types

[`associatedtype PublicKey : KEMPublicKey`](/documentation/CryptoKit/KEMOneTimePrivateKey/PublicKey-swift.associatedtype)

### Instance Properties

[`var publicKey: Self.PublicKey`](/documentation/CryptoKit/KEMOneTimePrivateKey/publicKey-swift.property)

The associated public key.

### Instance Methods

[`func decapsulate(Data) throws -> SymmetricKey`](/documentation/CryptoKit/KEMOneTimePrivateKey/decapsulate(_:))

Recovers a shared secret from an encapsulated representation.

### Type Methods

[`static func generate() throws -> Self`](/documentation/CryptoKit/KEMOneTimePrivateKey/generate())

Generates a new random private key.

## Relationships

### Inherits From

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

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

### Conforming Types

[`OneTimePrivateKey`](/documentation/CryptoKit/MLKEM768/OneTimePrivateKey)

[`OneTimePrivateKey`](/documentation/CryptoKit/MLKEM1024/OneTimePrivateKey)

[`OneTimePrivateKey`](/documentation/CryptoKit/XWingMLKEM768X25519/OneTimePrivateKey)

---

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)