---
title: "decapsulate(_:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/mlkem1024/privatekey/decapsulate(_:)"
---

# decapsulate(_:)

Decapsulate a shared secret.

## Declaration

```swift
func decapsulate<D>(_ encapsulated: D) throws -> SymmetricKey where D : DataProtocol
```

## Parameters

- `encapsulated`: An encapsulated shared secret, that you get by calling doc://com.apple.CryptoKit/documentation/CryptoKit/MLKEM1024/PublicKey/encapsulate() on the corresponding public key.

## Return Value

Return Value The shared secret.
