---
title: "open(_:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/hpke/recipient/open(_:)"
---

# open(_:)

Decrypts a message, if the ciphertext is valid.

## Declaration

```swift
mutating func open<C>(_ ciphertext: C) throws -> Data where C : DataProtocol
```

## Parameters

- `ciphertext`: The ciphertext message to decrypt.

## Return Value

Return Value The resulting cleartext message if the message is authentic.

## Discussion

Discussion You can call this method multiple times to decrypt a series of messages. When using this method, the recipient of the ciphertext messages needs to decrypt them in the same order that the sender encrypts them. note: The system throws errors from HPKE.Errors when it encounters them.
