---
title: "hpkeRepresentation(kem:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/hpkepublickeyserialization/hpkerepresentation(kem:)"
---

# hpkeRepresentation(kem:)

Creates an encoded representation of the public key.

## Declaration

```swift
func hpkeRepresentation(kem: HPKE.KEM) throws -> Data
```

## Return Value

Return Value The encoded key data.

## Discussion

Discussion kem: The key encapsulation mechanism for encapsulating the key.
