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

# decapsulate(_:)

Decapsulate a shared secret.

## Declaration

```swift
consuming func decapsulate(_ encapsulated: Data) throws -> SymmetricKey
```

## Parameters

- `encapsulated`: An encapsulated shared secret, that you get by calling XWingMLKEM768X25519/PublicKey/encapsulate() on the corresponding public key.

## Return Value

Return Value The shared secret.
