---
title: HPKE.Sender
framework: cryptokit
role: symbol
role_heading: Structure
path: cryptokit/hpke/sender
---

# HPKE.Sender

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

## Declaration

```swift
struct Sender
```

## Overview

Overview To create encrypted messages, initialize a Sender specifying the appropriate cipher suite, the recipient’s public key, and the additional cryptographic material relevant to your chosen mode of operation. Call seal(_:) or seal(_:authenticating:) on the Sender instance for each message in turn to retrieve its ciphertext. The recipient of the messages needs to process them in the same order as the Sender, using the same encryption mode, cipher suite, and key schedule information (info), as well as the Sender’s encapsulatedKey.

## Topics

### Initializers

- [init(recipientKey:ciphersuite:info:)](cryptokit/hpke/sender/init(recipientkey:ciphersuite:info:)-56p88.md)
- [init(recipientKey:ciphersuite:info:)](cryptokit/hpke/sender/init(recipientkey:ciphersuite:info:)-swk5.md)
- [init(recipientKey:ciphersuite:info:authenticatedBy:)](cryptokit/hpke/sender/init(recipientkey:ciphersuite:info:authenticatedby:).md)
- [init(recipientKey:ciphersuite:info:authenticatedBy:presharedKey:presharedKeyIdentifier:)](cryptokit/hpke/sender/init(recipientkey:ciphersuite:info:authenticatedby:presharedkey:presharedkeyidentifier:).md)
- [init(recipientKey:ciphersuite:info:presharedKey:presharedKeyIdentifier:)](cryptokit/hpke/sender/init(recipientkey:ciphersuite:info:presharedkey:presharedkeyidentifier:).md)

### Instance Properties

- [encapsulatedKey](cryptokit/hpke/sender/encapsulatedkey.md)

### Instance Methods

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

## Relationships

### Conforms To

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

## See Also

### Sending and receiving messages

- [HPKE.Recipient](cryptokit/hpke/recipient.md)
