<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/HPKE/Recipient/open(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit4HPKEO9RecipientV4openy10Foundation4DataVxKAG0G8ProtocolRzlF"
  },
  "title" : "open(_:)"
}
-->

# open(_:)

Decrypts a message, if the ciphertext is valid.

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

## Parameters

`ciphertext`

The ciphertext message to decrypt.

## Return Value

The resulting cleartext message if the message is authentic.

## 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 ``doc://com.apple.CryptoKit/documentation/CryptoKit/HPKE/Errors`` when it encounters them.

---

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)