---
title: HPKE.Recipient
framework: cryptokit
role: symbol
role_heading: Structure
path: cryptokit/hpke/recipient
---

# HPKE.Recipient

A type that represents the receiving side of an HPKE message exchange.

## Declaration

```swift
struct Recipient
```

## Overview

Overview To decrypt and verify the identity of encrypted messages, initialize a Recipient specifying the appropriate cipher suite, the receiver’s private key, the encapsulated symmetric key, and the additional cryptographic material relevant to your chosen mode of operation. Call open(_:) or open(_:authenticating:) on the Recipient instance for each message in turn to retrieve its cleartext. The recipient of the messages needs to process them in the same order as the Sender, using the same cipher suite, encryption mode, and key schedule information (info data). Use a separate Recipient instance for each stream of messages.

## Topics

### Initializers

- [init(privateKey:ciphersuite:info:encapsulatedKey:)](cryptokit/hpke/recipient/init(privatekey:ciphersuite:info:encapsulatedkey:)-6jqhf.md)
- [init(privateKey:ciphersuite:info:encapsulatedKey:)](cryptokit/hpke/recipient/init(privatekey:ciphersuite:info:encapsulatedkey:)-7v86b.md)
- [init(privateKey:ciphersuite:info:encapsulatedKey:authenticatedBy:)](cryptokit/hpke/recipient/init(privatekey:ciphersuite:info:encapsulatedkey:authenticatedby:).md)
- [init(privateKey:ciphersuite:info:encapsulatedKey:authenticatedBy:presharedKey:presharedKeyIdentifier:)](cryptokit/hpke/recipient/init(privatekey:ciphersuite:info:encapsulatedkey:authenticatedby:presharedkey:presharedkeyidentifier:).md)
- [init(privateKey:ciphersuite:info:encapsulatedKey:presharedKey:presharedKeyIdentifier:)](cryptokit/hpke/recipient/init(privatekey:ciphersuite:info:encapsulatedkey:presharedkey:presharedkeyidentifier:).md)

### Instance Methods

- [exportSecret(context:outputByteCount:)](cryptokit/hpke/recipient/exportsecret(context:outputbytecount:).md)
- [open(_:)](cryptokit/hpke/recipient/open(_:).md)
- [open(_:authenticating:)](cryptokit/hpke/recipient/open(_:authenticating:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Sending and receiving messages

- [HPKE.Sender](cryptokit/hpke/sender.md)
