<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/HPKE/Sender/init(recipientKey:ciphersuite:info:)-swk5",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit4HPKEO6SenderV12recipientKey11ciphersuite4infoAEx_AC11CiphersuiteV10Foundation4DataVtKcAA013HPKEKEMPublicF0Rzlufc"
  },
  "title" : "init(recipientKey:ciphersuite:info:)"
}
-->

# init(recipientKey:ciphersuite:info:)

Creates a sender in base mode.

```
init<PK>(recipientKey: PK, ciphersuite: HPKE.Ciphersuite, info: Data) throws where PK : HPKEKEMPublicKey
```

## Parameters

`recipientKey`

The recipient’s public key for encrypting the messages.

`ciphersuite`

The cipher suite that defines the cryptographic algorithms to use.

`info`

Data that the key derivation function uses to compute the symmetric key material. The sender and the recipient need to use the same `info` data.

## Discussion

The `Sender` encrypts messages in base mode with a symmetric encryption key it derives using a key derivation function (KDF).
The KDF uses the key schedule data in `info` as input to generate the key.
The `Sender` encapsulates the derived key using the recipient’s public key.
You access the encapsulated key using [`encapsulatedKey`](/documentation/CryptoKit/HPKE/Sender/encapsulatedKey).

> 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)